| 705 | } |
| 706 | |
| 707 | void MatrixDisplayUi::rotateTransition() |
| 708 | { |
| 709 | float progress = (float)this->state.ticksSinceLastStateSwitch / (float)this->ticksPerTransition; |
| 710 | float angle = progress * 2 * PI; // Rotate 360 degrees over the transition |
| 711 | |
| 712 | // Determine which app to draw |
| 713 | if (progress < 0.5) |
| 714 | { |
| 715 | // Rotate out the old app (progress from 0 to 0.5) |
| 716 | (this->AppFunctions[this->state.currentApp])(this->matrix, &this->state, 0, 0, &gif1); |
| 717 | } |
| 718 | else |
| 719 | { |
| 720 | // Rotate in the new app (progress from 0.5 to 1.0) |
| 721 | (this->AppFunctions[this->getnextAppNumber()])(this->matrix, &this->state, 0, 0, &gif2); |
| 722 | } |
| 723 | |
| 724 | // Copy the data to the temporary array ledsCopy |
| 725 | for (int i = 0; i < 32; i++) |
| 726 | { |
| 727 | for (int j = 0; j < 8; j++) |
| 728 | { |
| 729 | ledsCopy[i + j * 32] = DisplayManager.getLeds()[this->matrix->XY(i, j)]; |
| 730 | } |
| 731 | } |
| 732 | |
| 733 | // Rotate the data and copy back to the matrix |
| 734 | for (int i = 0; i < 32; i++) |
| 735 | { |
| 736 | for (int j = 0; j < 8; j++) |
| 737 | { |
| 738 | int iRotated = i; |
| 739 | int jRotated = j; |
| 740 | rotate(iRotated, jRotated, angle); |
| 741 | |
| 742 | if (iRotated < 0) |
| 743 | iRotated = 0; |
| 744 | if (iRotated >= 32) |
| 745 | iRotated = 31; |
| 746 | if (jRotated < 0) |
| 747 | jRotated = 0; |
| 748 | if (jRotated >= 8) |
| 749 | jRotated = 7; |
| 750 | |
| 751 | DisplayManager.getLeds()[this->matrix->XY(i, j)] = ledsCopy[iRotated + jRotated * 32]; |
| 752 | } |
| 753 | } |
| 754 | } |
| 755 | |
| 756 | void MatrixDisplayUi::pixelateTransition() |
| 757 | { |
nothing calls this directly
no test coverage detected