| 448 | } |
| 449 | |
| 450 | void Painter::PaintVuSpaceInvaders(uint32_t /*now_ms*/, |
| 451 | const KeyboardState& keyboard, |
| 452 | const int* led_column_table, int led_column_table_length, |
| 453 | LedRopeInterface* led_rope) { |
| 454 | led_rope->RawBeginDraw(); |
| 455 | |
| 456 | Color3i black = Color3i::Black(); |
| 457 | |
| 458 | for (int i = 0; i < led_column_table_length; ++i) { |
| 459 | const Key& key = keyboard.mKeys[i]; |
| 460 | |
| 461 | const int pixel_count = led_column_table[i]; |
| 462 | const int draw_pixel_count = fl::ceil(pixel_count * fl::sqrt(key.mCurrColor.v_)); |
| 463 | |
| 464 | const int black_pixel_count = pixel_count - draw_pixel_count; |
| 465 | |
| 466 | // If i is even |
| 467 | if (i % 2 == 0) { |
| 468 | for (int j = 0; j < black_pixel_count; ++j) { |
| 469 | led_rope->RawDrawPixel(*led_rope->GetIterator(i)); |
| 470 | } |
| 471 | for (int j = 0; j < draw_pixel_count; ++j) { |
| 472 | led_rope->RawDrawPixel(black); |
| 473 | } |
| 474 | } else { |
| 475 | |
| 476 | for (int j = 0; j < draw_pixel_count; ++j) { |
| 477 | led_rope->RawDrawPixel(black); |
| 478 | } |
| 479 | |
| 480 | for (int j = 0; j < black_pixel_count; ++j) { |
| 481 | led_rope->RawDrawPixel(*led_rope->GetIterator(i)); |
| 482 | } |
| 483 | } |
| 484 | } |
| 485 | led_rope->RawCommitDraw(); |
| 486 | } |
nothing calls this directly
no test coverage detected