a mega cool windows xp app
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat: reduce the visuals to make it less flickery

dunkirk.sh 1956c9c0 cf999246

verified
+37 -45
+37 -45
main.cpp
··· 193 193 RECT rect; 194 194 GetClientRect(hwnd, &rect); 195 195 196 + // Create double buffer to eliminate flicker 197 + HDC memDC = CreateCompatibleDC(hdc); 198 + HBITMAP memBitmap = CreateCompatibleBitmap(hdc, rect.right, rect.bottom); 199 + HBITMAP oldBitmap = (HBITMAP)SelectObject(memDC, memBitmap); 200 + 196 201 // Update VU levels before drawing 197 202 if (g_radio.power) { 198 203 UpdateVULevels(); 199 204 } 200 205 201 - DrawRadioInterface(hdc, &rect); 206 + DrawRadioInterface(memDC, &rect); 207 + 208 + // Copy from memory DC to screen 209 + BitBlt(hdc, 0, 0, rect.right, rect.bottom, memDC, 0, 0, SRCCOPY); 210 + 211 + // Cleanup 212 + SelectObject(memDC, oldBitmap); 213 + DeleteObject(memBitmap); 214 + DeleteDC(memDC); 202 215 203 216 EndPaint(hwnd, &ps); 204 217 return 0; ··· 398 411 return 0; 399 412 400 413 case WM_TIMER: { 401 - // Timer for VU meter updates 414 + // Timer for VU meter updates - only invalidate VU meter area 402 415 if (g_radio.power) { 403 - InvalidateRect(hwnd, NULL, FALSE); 416 + RECT vuRect = {440, 190, 540, 250}; 417 + InvalidateRect(hwnd, &vuRect, FALSE); 404 418 } 405 419 return 0; 406 420 } ··· 415 429 FillRect(hdc, rect, darkBrush); 416 430 DeleteObject(darkBrush); 417 431 418 - // Main panel with metallic gradient effect 432 + // Main panel with simplified metallic gradient effect 419 433 RECT panel = {10, 10, rect->right - 10, rect->bottom - 10}; 420 434 421 - // Create gradient effect by drawing multiple rectangles 422 - for (int i = 0; i < 20; i++) { 423 - int gray = 45 + i * 2; 435 + // Simplified gradient effect with fewer steps 436 + for (int i = 0; i < 8; i++) { 437 + int gray = 45 + i * 3; 424 438 HBRUSH gradBrush = CreateSolidBrush(RGB(gray, gray, gray)); 425 439 RECT gradRect = {panel.left + i, panel.top + i, panel.right - i, panel.bottom - i}; 426 440 FrameRect(hdc, &gradRect, gradBrush); ··· 577 591 } 578 592 579 593 void DrawTuningDial(HDC hdc, int x, int y, int radius, float frequency) { 580 - // Metallic dial with chrome gradient 581 - for (int i = 0; i < 8; i++) { 582 - int gray = 80 + i * 10; 594 + // Simplified metallic dial with fewer gradient steps 595 + for (int i = 0; i < 4; i++) { 596 + int gray = 80 + i * 20; 583 597 HBRUSH gradBrush = CreateSolidBrush(RGB(gray, gray, gray)); 584 598 SelectObject(hdc, gradBrush); 585 - Ellipse(hdc, x - radius + i, y - radius + i, x + radius - i, y + radius - i); 599 + Ellipse(hdc, x - radius + i*2, y - radius + i*2, x + radius - i*2, y + radius - i*2); 586 600 DeleteObject(gradBrush); 587 601 } 588 602 ··· 645 659 646 660 DeleteObject(tickPen); 647 661 648 - // Chrome-style pointer with shadow 662 + // Simplified pointer 649 663 float normalizedFreq = (frequency - 10.0f) / 24.0f; 650 664 float angle = -3.14159f * 0.75f + normalizedFreq * (3.14159f * 1.5f); 651 665 int pointerX = x + (int)((radius - 15) * cos(angle)); 652 666 int pointerY = y + (int)((radius - 15) * sin(angle)); 653 667 654 - // Pointer shadow 655 - HPEN shadowPen = CreatePen(PS_SOLID, 4, RGB(32, 32, 32)); 656 - SelectObject(hdc, shadowPen); 657 - MoveToEx(hdc, x + 1, y + 1, NULL); 658 - LineTo(hdc, pointerX + 1, pointerY + 1); 659 - DeleteObject(shadowPen); 660 - 661 668 // Main pointer 662 669 HPEN pointerPen = CreatePen(PS_SOLID, 3, RGB(255, 64, 64)); 663 670 SelectObject(hdc, pointerPen); ··· 686 693 } 687 694 688 695 void DrawVolumeKnob(HDC hdc, int x, int y, int radius, float volume) { 689 - // Chrome gradient knob 690 - for (int i = 0; i < 6; i++) { 691 - int gray = 100 + i * 15; 696 + // Simplified chrome gradient knob 697 + for (int i = 0; i < 3; i++) { 698 + int gray = 100 + i * 30; 692 699 HBRUSH gradBrush = CreateSolidBrush(RGB(gray, gray, gray)); 693 700 SelectObject(hdc, gradBrush); 694 - Ellipse(hdc, x - radius + i, y - radius + i, x + radius - i, y + radius - i); 701 + Ellipse(hdc, x - radius + i*2, y - radius + i*2, x + radius - i*2, y + radius - i*2); 695 702 DeleteObject(gradBrush); 696 703 } 697 704 ··· 707 714 Ellipse(hdc, x - radius, y - radius, x + radius, y + radius); 708 715 DeleteObject(ringPen); 709 716 710 - // Volume indicator with glow 717 + // Volume indicator 711 718 float angle = volume * 3.14159f * 1.5f - 3.14159f * 0.75f; 712 719 int indicatorX = x + (int)((radius - 8) * cos(angle)); 713 720 int indicatorY = y + (int)((radius - 8) * sin(angle)); 714 - 715 - // Indicator shadow 716 - HPEN shadowPen = CreatePen(PS_SOLID, 3, RGB(32, 32, 32)); 717 - SelectObject(hdc, shadowPen); 718 - MoveToEx(hdc, x + 1, y + 1, NULL); 719 - LineTo(hdc, indicatorX + 1, indicatorY + 1); 720 - DeleteObject(shadowPen); 721 721 722 722 // Main indicator 723 723 HPEN indicatorPen = CreatePen(PS_SOLID, 2, RGB(255, 255, 255)); ··· 918 918 } 919 919 920 920 void DrawPowerButton(HDC hdc, int x, int y, int radius, int power) { 921 - // Chrome gradient button 922 - for (int i = 0; i < 6; i++) { 923 - int intensity = power ? (80 + i * 20) : (60 + i * 10); 924 - COLORREF buttonColor = power ? RGB(255 - i * 20, intensity, intensity) : RGB(intensity, intensity, intensity); 921 + // Simplified chrome gradient button 922 + for (int i = 0; i < 3; i++) { 923 + int intensity = power ? (80 + i * 40) : (60 + i * 20); 924 + COLORREF buttonColor = power ? RGB(255 - i * 40, intensity, intensity) : RGB(intensity, intensity, intensity); 925 925 HBRUSH buttonBrush = CreateSolidBrush(buttonColor); 926 926 SelectObject(hdc, buttonBrush); 927 - Ellipse(hdc, x - radius + i, y - radius + i, x + radius - i, y + radius - i); 927 + Ellipse(hdc, x - radius + i*2, y - radius + i*2, x + radius - i*2, y + radius - i*2); 928 928 DeleteObject(buttonBrush); 929 929 } 930 930 ··· 941 941 Ellipse(hdc, x - radius, y - radius, x + radius, y + radius); 942 942 DeleteObject(borderPen); 943 943 944 - // Power symbol with glow effect 944 + // Power symbol 945 945 if (power) { 946 - // Glow effect 947 - HPEN glowPen = CreatePen(PS_SOLID, 5, RGB(255, 64, 64)); 948 - SelectObject(hdc, glowPen); 949 - Arc(hdc, x - 10, y - 10, x + 10, y + 10, x + 8, y - 8, x - 8, y - 8); 950 - MoveToEx(hdc, x, y - 12, NULL); 951 - LineTo(hdc, x, y - 4); 952 - DeleteObject(glowPen); 953 - 954 946 // Main symbol 955 947 HPEN symbolPen = CreatePen(PS_SOLID, 3, RGB(255, 255, 255)); 956 948 SelectObject(hdc, symbolPen);