diff --git a/src/droplets/vco_droplet.cpp b/src/droplets/vco_droplet.cpp index 6f6c1a6..6e139ca 100644 --- a/src/droplets/vco_droplet.cpp +++ b/src/droplets/vco_droplet.cpp @@ -56,7 +56,6 @@ void VCODroplet::Draw() { if(NeedUpdate()) { wave->AdjustXShift(1); } - //testWave->DrawTile(*Patch(), 0, GetTitleHeight(), 60, GetTitleHeight()+testH); DrawName("VCO"); AnimationInc(); } diff --git a/src/droplets/vco_droplet.h b/src/droplets/vco_droplet.h index 5bf5082..adf1fbf 100644 --- a/src/droplets/vco_droplet.h +++ b/src/droplets/vco_droplet.h @@ -22,10 +22,7 @@ private: std::string WaveToString(uint8_t); void SetWaveState(uint8_t); const double pi = std::acos(-1); - int sine_width = 21; - Wave* wave = new Wave(WaveShape::kTriangle, sine_width, GetTitleHeight()); - int testH = 20; - //Wave* testWave = new Wave(WaveShape::kSaw, 30, testH); + Wave* wave = new Wave(WaveShape::kTriangle, 21, GetTitleHeight()); public: VCODroplet(DaisyPatch*, DropletState, float); ~VCODroplet(); diff --git a/src/graphics/sprite.cpp b/src/graphics/sprite.cpp index 1afad58..1a91312 100644 --- a/src/graphics/sprite.cpp +++ b/src/graphics/sprite.cpp @@ -54,7 +54,6 @@ int Sprite::GetHeight() { return height; } - int Sprite::GetWidth() { return width; @@ -117,7 +116,9 @@ void Sprite::AdjustYShift(int y) { y_shift += y; } -int Sprite::GetShiftArray(int pos, int shift, int array_size) { +int Sprite::GetShiftArray(int pos, + int shift, + int array_size) { return (array_size + ((pos + shift) % array_size)) % array_size; } diff --git a/src/graphics/wave.cpp b/src/graphics/wave.cpp index cfaec25..04df2e9 100644 --- a/src/graphics/wave.cpp +++ b/src/graphics/wave.cpp @@ -1,6 +1,8 @@ #include "wave.h" -Wave::Wave(WaveShape m_wave, int width, int height) : Sprite(width, height) { +Wave::Wave(WaveShape m_wave, + int width, + int height) : Sprite(width, height) { wave = m_wave; DrawShape(); } @@ -28,7 +30,7 @@ void Wave::DrawShape() { case WaveShape::kSine: default: for (int i = 0; i < GetWidth(); i++) { - int pixel = (int) round(std::sin(2*pi*((double)(i%GetWidth())/GetWidth())) * (GetHeight()/2) + GetHeight()/2); + int pixel = (int) round(std::sin(2*pi*((double)(i%x_max)/x_max)) * (y_max/2) + y_max/2); AddPixel(i, pixel, true); } return;