141 {
142
143
144
145
146 uint8_t dataSmoothing = 0;
148 dataSmoothing = 200 - (
speed * 4);
149 }
150
151 for (uint16_t i = 0; i <
width; i++) {
152 int ioffset =
scale * i;
153 for (uint16_t j = 0; j <
height; j++) {
154 int joffset =
scale * j;
155
157
158
159
160
161
162 data =
qsub8(data, 16);
164
165 if (dataSmoothing) {
167 uint8_t newdata =
scale8(olddata, dataSmoothing) +
168 scale8(data, 256 - dataSmoothing);
169 data = newdata;
170 }
171
173 }
174 }
175
177
178
181}
fl::scoped_array< uint8_t > noise
LIB8STATIC_ALWAYS_INLINE uint8_t qadd8(uint8_t i, uint8_t j)
Add one byte to another, saturating at 0xFF.
LIB8STATIC_ALWAYS_INLINE uint8_t qsub8(uint8_t i, uint8_t j)
Subtract one byte from another, saturating at 0x00.
uint8_t inoise8(uint16_t x, uint16_t y, uint16_t z)
8-Bit, fixed point implementation of Perlin's noise.
LIB8STATIC_ALWAYS_INLINE uint8_t scale8(uint8_t i, fract8 scale)
Scale one byte by a second one, which is treated as the numerator of a fraction whose denominator is ...