mirror of
				https://github.com/AquaMorph/Droplets.git
				synced 2025-10-31 08:23:18 +00:00 
			
		
		
		
	Sprite line drawing and wave drawing outline
This commit is contained in:
		| @@ -16,12 +16,6 @@ VCODroplet::VCODroplet(DaisyPatch* m_patch, | ||||
| 		num_waves, Parameter::LINEAR); | ||||
|   ampctrl.Init(Patch()->controls[Patch()->CTRL_4], 0.0, | ||||
| 	       0.5f, Parameter::LINEAR); | ||||
|  | ||||
|   wave->SetBlank(); | ||||
|   for (int i = 0; i < sine_width; i++) { | ||||
|     int pixel = (int) round(std::sin(2*pi*((double)(i%sine_width)/sine_width)) * (GetTitleHeight()/2) + GetTitleHeight()/2); | ||||
|     wave->SetPixel(i, pixel, true); | ||||
|   } | ||||
| } | ||||
|  | ||||
| VCODroplet::~VCODroplet() { | ||||
| @@ -59,7 +53,7 @@ void VCODroplet::Draw() { | ||||
| 	      WaveToString(wavectrl.Process())); | ||||
|   wave->DrawTile(*Patch(), GetScreenMin(), 0, GetScreenMax(), GetTitleHeight()); | ||||
|   if(NeedUpdate()) { | ||||
|     wave->AdjustXShift(1); | ||||
|     //wave->AdjustXShift(1); | ||||
|   } | ||||
|   DrawName("VCO"); | ||||
|   AnimationInc(); | ||||
|   | ||||
| @@ -10,7 +10,7 @@ | ||||
|  | ||||
| #include "droplet.h" | ||||
| #include "../util.h" | ||||
| #include "../graphics/sprite.h" | ||||
| #include "../graphics/wave.h" | ||||
|  | ||||
| using namespace daisy; | ||||
| using namespace daisysp; | ||||
| @@ -22,7 +22,7 @@ private: | ||||
|   std::string WaveToString(uint8_t); | ||||
|   const double pi = std::acos(-1); | ||||
|   int sine_width = 20; | ||||
|   Sprite* wave = new Sprite(sine_width, GetTitleHeight()); | ||||
|   Wave* wave = new Wave(WaveShape::kTriangle, sine_width, GetTitleHeight()); | ||||
| public: | ||||
|   VCODroplet(DaisyPatch*, DropletState, float); | ||||
|   ~VCODroplet(); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user