@@ -605,34 +605,35 @@ SDL_FORCE_INLINE void BlitBto4Key(SDL_BlitInfo *info, const Uint32 srcbpp)
605
605
}
606
606
}
607
607
608
- SDL_FORCE_INLINE void BlitBtoNAlpha (SDL_BlitInfo * info , const Uint32 srcbpp )
608
+ static void BlitBtoNAlpha (SDL_BlitInfo * info )
609
609
{
610
- const Uint32 mask = (1 << srcbpp ) - 1 ;
611
- const Uint32 align = (8 / srcbpp ) - 1 ;
612
-
613
610
int width = info -> dst_w ;
614
611
int height = info -> dst_h ;
615
612
Uint8 * src = info -> src ;
616
613
Uint8 * dst = info -> dst ;
617
614
int srcskip = info -> src_skip ;
618
615
int dstskip = info -> dst_skip ;
619
616
const SDL_Color * srcpal = info -> src_fmt -> palette -> colors ;
617
+ SDL_PixelFormat * srcfmt = info -> src_fmt ;
620
618
SDL_PixelFormat * dstfmt = info -> dst_fmt ;
621
- int dstbpp ;
619
+ int srcbpp , dstbpp ;
622
620
int c ;
623
- Uint32 pixel ;
621
+ Uint32 pixel , mask , align ;
624
622
unsigned sR , sG , sB ;
625
623
unsigned dR , dG , dB , dA ;
626
624
const unsigned A = info -> a ;
627
625
628
626
/* Set up some basic variables */
627
+ srcbpp = srcfmt -> BytesPerPixel ;
629
628
dstbpp = dstfmt -> BytesPerPixel ;
630
629
if (srcbpp == 4 )
631
630
srcskip += width - (width + 1 ) / 2 ;
632
631
else if (srcbpp == 2 )
633
632
srcskip += width - (width + 3 ) / 4 ;
634
633
else if (srcbpp == 1 )
635
634
srcskip += width - (width + 7 ) / 8 ;
635
+ mask = (1 << srcbpp ) - 1 ;
636
+ align = (8 / srcbpp ) - 1 ;
636
637
637
638
if (SDL_PIXELORDER (info -> src_fmt -> format ) == SDL_BITMAPORDER_4321 ) {
638
639
while (height -- ) {
@@ -681,11 +682,8 @@ SDL_FORCE_INLINE void BlitBtoNAlpha(SDL_BlitInfo *info, const Uint32 srcbpp)
681
682
}
682
683
}
683
684
684
- SDL_FORCE_INLINE void BlitBtoNAlphaKey (SDL_BlitInfo * info , const Uint32 srcbpp )
685
+ static void BlitBtoNAlphaKey (SDL_BlitInfo * info )
685
686
{
686
- const Uint32 mask = (1 << srcbpp ) - 1 ;
687
- const Uint32 align = (8 / srcbpp ) - 1 ;
688
-
689
687
int width = info -> dst_w ;
690
688
int height = info -> dst_h ;
691
689
Uint8 * src = info -> src ;
@@ -695,22 +693,25 @@ SDL_FORCE_INLINE void BlitBtoNAlphaKey(SDL_BlitInfo *info, const Uint32 srcbpp)
695
693
SDL_PixelFormat * srcfmt = info -> src_fmt ;
696
694
SDL_PixelFormat * dstfmt = info -> dst_fmt ;
697
695
const SDL_Color * srcpal = srcfmt -> palette -> colors ;
698
- int dstbpp ;
696
+ int srcbpp , dstbpp ;
699
697
int c ;
700
- Uint32 pixel ;
698
+ Uint32 pixel , mask , align ;
701
699
unsigned sR , sG , sB ;
702
700
unsigned dR , dG , dB , dA ;
703
701
const unsigned A = info -> a ;
704
702
Uint32 ckey = info -> colorkey ;
705
703
706
704
/* Set up some basic variables */
705
+ srcbpp = srcfmt -> BytesPerPixel ;
707
706
dstbpp = dstfmt -> BytesPerPixel ;
708
707
if (srcbpp == 4 )
709
708
srcskip += width - (width + 1 ) / 2 ;
710
709
else if (srcbpp == 2 )
711
710
srcskip += width - (width + 3 ) / 4 ;
712
711
else if (srcbpp == 1 )
713
712
srcskip += width - (width + 7 ) / 8 ;
713
+ mask = (1 << srcbpp ) - 1 ;
714
+ align = (8 / srcbpp ) - 1 ;
714
715
715
716
if (SDL_PIXELORDER (info -> src_fmt -> format ) == SDL_BITMAPORDER_4321 ) {
716
717
while (height -- ) {
@@ -801,16 +802,6 @@ static const SDL_BlitFunc colorkey_blit_1b[] = {
801
802
(SDL_BlitFunc )NULL , Blit1bto1Key , Blit1bto2Key , Blit1bto3Key , Blit1bto4Key
802
803
};
803
804
804
- static void Blit1btoNAlpha (SDL_BlitInfo * info )
805
- {
806
- BlitBtoNAlpha (info , 1 );
807
- }
808
-
809
- static void Blit1btoNAlphaKey (SDL_BlitInfo * info )
810
- {
811
- BlitBtoNAlphaKey (info , 1 );
812
- }
813
-
814
805
815
806
816
807
static void Blit2bto1 (SDL_BlitInfo * info ) {
@@ -853,16 +844,6 @@ static const SDL_BlitFunc colorkey_blit_2b[] = {
853
844
(SDL_BlitFunc )NULL , Blit2bto1Key , Blit2bto2Key , Blit2bto3Key , Blit2bto4Key
854
845
};
855
846
856
- static void Blit2btoNAlpha (SDL_BlitInfo * info )
857
- {
858
- BlitBtoNAlpha (info , 2 );
859
- }
860
-
861
- static void Blit2btoNAlphaKey (SDL_BlitInfo * info )
862
- {
863
- BlitBtoNAlphaKey (info , 2 );
864
- }
865
-
866
847
867
848
868
849
static void Blit4bto1 (SDL_BlitInfo * info ) {
@@ -905,16 +886,6 @@ static const SDL_BlitFunc colorkey_blit_4b[] = {
905
886
(SDL_BlitFunc )NULL , Blit4bto1Key , Blit4bto2Key , Blit4bto3Key , Blit4bto4Key
906
887
};
907
888
908
- static void Blit4btoNAlpha (SDL_BlitInfo * info )
909
- {
910
- BlitBtoNAlpha (info , 4 );
911
- }
912
-
913
- static void Blit4btoNAlphaKey (SDL_BlitInfo * info )
914
- {
915
- BlitBtoNAlphaKey (info , 4 );
916
- }
917
-
918
889
919
890
920
891
SDL_BlitFunc SDL_CalculateBlit0 (SDL_Surface * surface )
@@ -936,10 +907,10 @@ SDL_BlitFunc SDL_CalculateBlit0(SDL_Surface *surface)
936
907
return colorkey_blit_1b [which ];
937
908
938
909
case SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND :
939
- return which >= 2 ? Blit1btoNAlpha : (SDL_BlitFunc )NULL ;
910
+ return which >= 2 ? BlitBtoNAlpha : (SDL_BlitFunc )NULL ;
940
911
941
912
case SDL_COPY_COLORKEY | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND :
942
- return which >= 2 ? Blit1btoNAlphaKey : (SDL_BlitFunc )NULL ;
913
+ return which >= 2 ? BlitBtoNAlphaKey : (SDL_BlitFunc )NULL ;
943
914
}
944
915
return NULL ;
945
916
}
@@ -953,10 +924,10 @@ SDL_BlitFunc SDL_CalculateBlit0(SDL_Surface *surface)
953
924
return colorkey_blit_2b [which ];
954
925
955
926
case SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND :
956
- return which >= 2 ? Blit2btoNAlpha : (SDL_BlitFunc )NULL ;
927
+ return which >= 2 ? BlitBtoNAlpha : (SDL_BlitFunc )NULL ;
957
928
958
929
case SDL_COPY_COLORKEY | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND :
959
- return which >= 2 ? Blit2btoNAlphaKey : (SDL_BlitFunc )NULL ;
930
+ return which >= 2 ? BlitBtoNAlphaKey : (SDL_BlitFunc )NULL ;
960
931
}
961
932
return NULL ;
962
933
}
@@ -970,10 +941,10 @@ SDL_BlitFunc SDL_CalculateBlit0(SDL_Surface *surface)
970
941
return colorkey_blit_4b [which ];
971
942
972
943
case SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND :
973
- return which >= 2 ? Blit4btoNAlpha : (SDL_BlitFunc )NULL ;
944
+ return which >= 2 ? BlitBtoNAlpha : (SDL_BlitFunc )NULL ;
974
945
975
946
case SDL_COPY_COLORKEY | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND :
976
- return which >= 2 ? Blit4btoNAlphaKey : (SDL_BlitFunc )NULL ;
947
+ return which >= 2 ? BlitBtoNAlphaKey : (SDL_BlitFunc )NULL ;
977
948
}
978
949
return NULL ;
979
950
}
0 commit comments