//////////////////////////////////////////////////////////////////////////
| 170 | |
| 171 | /////////////////////////////////////////////////////////////////////////////// |
| 172 | void LedRopeTCL::DrawRepeat(const int* value_array, int array_length) { |
| 173 | RawBeginDraw(); |
| 174 | |
| 175 | // Make sure that the number of colors to repeat does not exceed the length |
| 176 | // of the rope. |
| 177 | const int len = fl::min(array_length, mFrameBuffer.length()); |
| 178 | |
| 179 | for (int i = 0; i < len; ++i) { |
| 180 | const Color3i* cur_color = GetIterator(i); // Current color. |
| 181 | const int repeat_count = value_array[i]; |
| 182 | // Repeatedly send the same color down the led rope. |
| 183 | for (int k = 0; k < repeat_count; ++k) { |
| 184 | RawDrawPixel(cur_color->r_, cur_color->g_, cur_color->b_); |
| 185 | } |
| 186 | } |
| 187 | // Finish the drawing. |
| 188 | RawCommitDraw(); |
| 189 | } |
| 190 |