| 81 | } |
| 82 | |
| 83 | static void drawPanel(SDL_Renderer* r, int x, int y, int w, int h, const char* label, float level, bool active, |
| 84 | uint8_t cr, uint8_t cg, uint8_t cb, int packets) |
| 85 | { |
| 86 | SDL_SetRenderDrawColor(r, active ? static_cast<uint8_t>(50) : static_cast<uint8_t>(30), |
| 87 | active ? static_cast<uint8_t>(50) : static_cast<uint8_t>(30), |
| 88 | active ? static_cast<uint8_t>(65) : static_cast<uint8_t>(40), 255); |
| 89 | SDL_FRect panel = {static_cast<float>(x), static_cast<float>(y), static_cast<float>(w), static_cast<float>(h)}; |
| 90 | SDL_RenderFillRect(r, &panel); |
| 91 | if (active) |
| 92 | { |
| 93 | SDL_SetRenderDrawColor(r, cr, cg, cb, 255); |
| 94 | SDL_FRect indicator = {static_cast<float>(x + 8), static_cast<float>(y + 8), 12.0f, 12.0f}; |
| 95 | SDL_RenderFillRect(r, &indicator); |
| 96 | } |
| 97 | else |
| 98 | { |
| 99 | SDL_SetRenderDrawColor(r, 80, 80, 80, 255); |
| 100 | SDL_FRect indicator = {static_cast<float>(x + 8), static_cast<float>(y + 8), 12.0f, 12.0f}; |
| 101 | SDL_RenderRect(r, &indicator); |
| 102 | } |
| 103 | drawMeter(r, x + 8, y + h - 28, w - 16, 20, level * 5.0f, cr, cg, cb); |
| 104 | } |
| 105 | |
| 106 | static int ExecuteTest(int delayMs) |
| 107 | { |
no test coverage detected