diff options
author | Daniel Garcia <danielgarcia@gmail.com> | 2014-10-25 05:12:08 +0400 |
---|---|---|
committer | Daniel Garcia <danielgarcia@gmail.com> | 2014-10-25 05:12:08 +0400 |
commit | ff85488b7974d5b063c7dc9f6f1ac65ac2c77ec9 (patch) | |
tree | 4b8b982958e2da7a2c1afdc0149a4bf58ea8efb7 /noise.cpp | |
parent | e9b0597130847a1101b11ce9be9a7eff343cd1be (diff) | |
parent | 998564784bdedf7a2bcfe50b183f1fa653b87a96 (diff) |
resolving conflicts
Diffstat (limited to 'noise.cpp')
-rw-r--r-- | noise.cpp | 18 |
1 files changed, 12 insertions, 6 deletions
@@ -5,6 +5,14 @@ #define USE_PROGMEM #endif +// Workaround for http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34734 +#ifdef FASTLED_AVR +#ifdef PROGMEM +#undef PROGMEM +#define PROGMEM __attribute__((section(".progmem.data"))) +#endif +#endif + #ifdef USE_PROGMEM #define FL_PROGMEM PROGMEM #define P(x) pgm_read_byte_near(p + x) @@ -519,7 +527,6 @@ void fill_raw_2dnoise16(uint16_t *pData, int width, int height, uint8_t octaves, scalex *= skip; scaley *= skip; - uint32_t xx = x; fract16 invamp = 65535-amplitude; for(int i = 0; i < height; i+=skip, y+=scaley) { uint16_t *pRow = pData + (i*width); @@ -652,7 +659,7 @@ void fill_2dnoise8(CRGB *leds, int width, int height, bool serpentine, void fill_2dnoise16(CRGB *leds, int width, int height, bool serpentine, uint8_t octaves, uint32_t x, int xscale, uint32_t y, int yscale, uint32_t time, - uint8_t hue_octaves, uint16_t hue_x, int hue_xscale, uint16_t hue_y, uint16_t hue_yscale,uint16_t hue_time, bool blend) { + uint8_t hue_octaves, uint16_t hue_x, int hue_xscale, uint16_t hue_y, uint16_t hue_yscale,uint16_t hue_time, bool blend, uint16_t hue_shift) { uint8_t V[height][width]; uint8_t H[height][width]; @@ -667,13 +674,12 @@ void fill_2dnoise16(CRGB *leds, int width, int height, bool serpentine, int w1 = width-1; int h1 = height-1; - static int hz = 0; - uint8_t hue_off = hz>>8; - hz += 123; + hue_shift >>= 8; + for(int i = 0; i < height; i++) { int wb = i*width; for(int j = 0; j < width; j++) { - CRGB led(CHSV(hue_off + H[h1-i][h1-j],210,V[i][j])); + CRGB led(CHSV(hue_shift + (H[h1-i][w1-j]),196,V[i][j])); int pos = j; if(serpentine && (i & 0x1)) { |