@@ -702,70 +702,84 @@ void SetWindowIcon(Image image)
702
702
switch (image .format )
703
703
{
704
704
case PIXELFORMAT_UNCOMPRESSED_GRAYSCALE :
705
+ {
705
706
rmask = 0xFF , gmask = 0 ;
706
707
bmask = 0 , amask = 0 ;
707
708
depth = 8 , pitch = image .width ;
708
- break ;
709
+ } break ;
709
710
case PIXELFORMAT_UNCOMPRESSED_GRAY_ALPHA :
711
+ {
710
712
rmask = 0xFF , gmask = 0xFF00 ;
711
713
bmask = 0 , amask = 0 ;
712
714
depth = 16 , pitch = image .width * 2 ;
713
- break ;
715
+ } break ;
714
716
case PIXELFORMAT_UNCOMPRESSED_R5G6B5 :
717
+ {
715
718
rmask = 0xF800 , gmask = 0x07E0 ;
716
719
bmask = 0x001F , amask = 0 ;
717
720
depth = 16 , pitch = image .width * 2 ;
718
- break ;
719
- case PIXELFORMAT_UNCOMPRESSED_R8G8B8 : // Uses BGR for 24-bit
720
- rmask = 0x0000FF , gmask = 0x00FF00 ;
721
- bmask = 0xFF0000 , amask = 0 ;
721
+ } break ;
722
+ case PIXELFORMAT_UNCOMPRESSED_R8G8B8 :
723
+ {
724
+ // WARNING: SDL2 could be using BGR but SDL3 RGB
725
+ rmask = 0xFF0000 , gmask = 0x00FF00 ;
726
+ bmask = 0x0000FF , amask = 0 ;
722
727
depth = 24 , pitch = image .width * 3 ;
723
- break ;
728
+ } break ;
724
729
case PIXELFORMAT_UNCOMPRESSED_R5G5B5A1 :
730
+ {
725
731
rmask = 0xF800 , gmask = 0x07C0 ;
726
732
bmask = 0x003E , amask = 0x0001 ;
727
733
depth = 16 , pitch = image .width * 2 ;
728
- break ;
734
+ } break ;
729
735
case PIXELFORMAT_UNCOMPRESSED_R4G4B4A4 :
736
+ {
730
737
rmask = 0xF000 , gmask = 0x0F00 ;
731
738
bmask = 0x00F0 , amask = 0x000F ;
732
739
depth = 16 , pitch = image .width * 2 ;
733
- break ;
740
+ } break ;
734
741
case PIXELFORMAT_UNCOMPRESSED_R8G8B8A8 :
742
+ {
735
743
rmask = 0xFF000000 , gmask = 0x00FF0000 ;
736
744
bmask = 0x0000FF00 , amask = 0x000000FF ;
737
745
depth = 32 , pitch = image .width * 4 ;
738
- break ;
746
+ } break ;
739
747
case PIXELFORMAT_UNCOMPRESSED_R32 :
748
+ {
740
749
rmask = 0xFFFFFFFF , gmask = 0 ;
741
750
bmask = 0 , amask = 0 ;
742
751
depth = 32 , pitch = image .width * 4 ;
743
- break ;
752
+ } break ;
744
753
case PIXELFORMAT_UNCOMPRESSED_R32G32B32 :
754
+ {
745
755
rmask = 0xFFFFFFFF , gmask = 0xFFFFFFFF ;
746
756
bmask = 0xFFFFFFFF , amask = 0 ;
747
757
depth = 96 , pitch = image .width * 12 ;
748
- break ;
758
+ } break ;
749
759
case PIXELFORMAT_UNCOMPRESSED_R32G32B32A32 :
760
+ {
750
761
rmask = 0xFFFFFFFF , gmask = 0xFFFFFFFF ;
751
762
bmask = 0xFFFFFFFF , amask = 0xFFFFFFFF ;
752
763
depth = 128 , pitch = image .width * 16 ;
753
- break ;
764
+ } break ;
754
765
case PIXELFORMAT_UNCOMPRESSED_R16 :
766
+ {
755
767
rmask = 0xFFFF , gmask = 0 ;
756
768
bmask = 0 , amask = 0 ;
757
769
depth = 16 , pitch = image .width * 2 ;
758
- break ;
770
+ } break ;
759
771
case PIXELFORMAT_UNCOMPRESSED_R16G16B16 :
772
+ {
760
773
rmask = 0xFFFF , gmask = 0xFFFF ;
761
774
bmask = 0xFFFF , amask = 0 ;
762
775
depth = 48 , pitch = image .width * 6 ;
763
- break ;
776
+ } break ;
764
777
case PIXELFORMAT_UNCOMPRESSED_R16G16B16A16 :
778
+ {
765
779
rmask = 0xFFFF , gmask = 0xFFFF ;
766
780
bmask = 0xFFFF , amask = 0xFFFF ;
767
781
depth = 64 , pitch = image .width * 8 ;
768
- break ;
782
+ } break ;
769
783
default : return ; // Compressed formats are not supported
770
784
}
771
785
0 commit comments