@@ -799,7 +799,7 @@ void ImDrawList::PathRect(const ImVec2& a, const ImVec2& b, float rounding, int
799
799
800
800
void ImDrawList::AddLine (const ImVec2& a, const ImVec2& b, ImU32 col, float thickness)
801
801
{
802
- if ((col >> 24 ) == 0 )
802
+ if ((col & IM_COL32_A_MASK ) == 0 )
803
803
return ;
804
804
PathLineTo (a + ImVec2 (0 .5f ,0 .5f ));
805
805
PathLineTo (b + ImVec2 (0 .5f ,0 .5f ));
@@ -809,15 +809,15 @@ void ImDrawList::AddLine(const ImVec2& a, const ImVec2& b, ImU32 col, float thic
809
809
// a: upper-left, b: lower-right. we don't render 1 px sized rectangles properly.
810
810
void ImDrawList::AddRect (const ImVec2& a, const ImVec2& b, ImU32 col, float rounding, int rounding_corners, float thickness)
811
811
{
812
- if ((col >> 24 ) == 0 )
812
+ if ((col & IM_COL32_A_MASK ) == 0 )
813
813
return ;
814
814
PathRect (a + ImVec2 (0 .5f ,0 .5f ), b - ImVec2 (0 .5f ,0 .5f ), rounding, rounding_corners);
815
815
PathStroke (col, true , thickness);
816
816
}
817
817
818
818
void ImDrawList::AddRectFilled (const ImVec2& a, const ImVec2& b, ImU32 col, float rounding, int rounding_corners)
819
819
{
820
- if ((col >> 24 ) == 0 )
820
+ if ((col & IM_COL32_A_MASK ) == 0 )
821
821
return ;
822
822
if (rounding > 0 .0f )
823
823
{
@@ -833,7 +833,7 @@ void ImDrawList::AddRectFilled(const ImVec2& a, const ImVec2& b, ImU32 col, floa
833
833
834
834
void ImDrawList::AddRectFilledMultiColor (const ImVec2& a, const ImVec2& c, ImU32 col_upr_left, ImU32 col_upr_right, ImU32 col_bot_right, ImU32 col_bot_left)
835
835
{
836
- if (((col_upr_left | col_upr_right | col_bot_right | col_bot_left) >> 24 ) == 0 )
836
+ if (((col_upr_left | col_upr_right | col_bot_right | col_bot_left) & IM_COL32_A_MASK ) == 0 )
837
837
return ;
838
838
839
839
const ImVec2 uv = GImGui->FontTexUvWhitePixel ;
@@ -848,7 +848,7 @@ void ImDrawList::AddRectFilledMultiColor(const ImVec2& a, const ImVec2& c, ImU32
848
848
849
849
void ImDrawList::AddQuad (const ImVec2& a, const ImVec2& b, const ImVec2& c, const ImVec2& d, ImU32 col, float thickness)
850
850
{
851
- if ((col >> 24 ) == 0 )
851
+ if ((col & IM_COL32_A_MASK ) == 0 )
852
852
return ;
853
853
854
854
PathLineTo (a);
@@ -860,7 +860,7 @@ void ImDrawList::AddQuad(const ImVec2& a, const ImVec2& b, const ImVec2& c, cons
860
860
861
861
void ImDrawList::AddQuadFilled (const ImVec2& a, const ImVec2& b, const ImVec2& c, const ImVec2& d, ImU32 col)
862
862
{
863
- if ((col >> 24 ) == 0 )
863
+ if ((col & IM_COL32_A_MASK ) == 0 )
864
864
return ;
865
865
866
866
PathLineTo (a);
@@ -872,7 +872,7 @@ void ImDrawList::AddQuadFilled(const ImVec2& a, const ImVec2& b, const ImVec2& c
872
872
873
873
void ImDrawList::AddTriangle (const ImVec2& a, const ImVec2& b, const ImVec2& c, ImU32 col, float thickness)
874
874
{
875
- if ((col >> 24 ) == 0 )
875
+ if ((col & IM_COL32_A_MASK ) == 0 )
876
876
return ;
877
877
878
878
PathLineTo (a);
@@ -883,7 +883,7 @@ void ImDrawList::AddTriangle(const ImVec2& a, const ImVec2& b, const ImVec2& c,
883
883
884
884
void ImDrawList::AddTriangleFilled (const ImVec2& a, const ImVec2& b, const ImVec2& c, ImU32 col)
885
885
{
886
- if ((col >> 24 ) == 0 )
886
+ if ((col & IM_COL32_A_MASK ) == 0 )
887
887
return ;
888
888
889
889
PathLineTo (a);
@@ -894,7 +894,7 @@ void ImDrawList::AddTriangleFilled(const ImVec2& a, const ImVec2& b, const ImVec
894
894
895
895
void ImDrawList::AddCircle (const ImVec2& centre, float radius, ImU32 col, int num_segments, float thickness)
896
896
{
897
- if ((col >> 24 ) == 0 )
897
+ if ((col & IM_COL32_A_MASK ) == 0 )
898
898
return ;
899
899
900
900
const float a_max = IM_PI*2 .0f * ((float )num_segments - 1 .0f ) / (float )num_segments;
@@ -904,7 +904,7 @@ void ImDrawList::AddCircle(const ImVec2& centre, float radius, ImU32 col, int nu
904
904
905
905
void ImDrawList::AddCircleFilled (const ImVec2& centre, float radius, ImU32 col, int num_segments)
906
906
{
907
- if ((col >> 24 ) == 0 )
907
+ if ((col & IM_COL32_A_MASK ) == 0 )
908
908
return ;
909
909
910
910
const float a_max = IM_PI*2 .0f * ((float )num_segments - 1 .0f ) / (float )num_segments;
@@ -914,7 +914,7 @@ void ImDrawList::AddCircleFilled(const ImVec2& centre, float radius, ImU32 col,
914
914
915
915
void ImDrawList::AddBezierCurve (const ImVec2& pos0, const ImVec2& cp0, const ImVec2& cp1, const ImVec2& pos1, ImU32 col, float thickness, int num_segments)
916
916
{
917
- if ((col >> 24 ) == 0 )
917
+ if ((col & IM_COL32_A_MASK ) == 0 )
918
918
return ;
919
919
920
920
PathLineTo (pos0);
@@ -924,7 +924,7 @@ void ImDrawList::AddBezierCurve(const ImVec2& pos0, const ImVec2& cp0, const ImV
924
924
925
925
void ImDrawList::AddText (const ImFont* font, float font_size, const ImVec2& pos, ImU32 col, const char * text_begin, const char * text_end, float wrap_width, const ImVec4* cpu_fine_clip_rect)
926
926
{
927
- if ((col >> 24 ) == 0 )
927
+ if ((col & IM_COL32_A_MASK ) == 0 )
928
928
return ;
929
929
930
930
if (text_end == NULL )
@@ -959,7 +959,7 @@ void ImDrawList::AddText(const ImVec2& pos, ImU32 col, const char* text_begin, c
959
959
960
960
void ImDrawList::AddImage (ImTextureID user_texture_id, const ImVec2& a, const ImVec2& b, const ImVec2& uv0, const ImVec2& uv1, ImU32 col)
961
961
{
962
- if ((col >> 24 ) == 0 )
962
+ if ((col & IM_COL32_A_MASK ) == 0 )
963
963
return ;
964
964
965
965
// FIXME-OPT: This is wasting draw calls.
@@ -1169,7 +1169,7 @@ static void Decode85(const unsigned char* src, unsigned char* dst)
1169
1169
while (*src)
1170
1170
{
1171
1171
unsigned int tmp = Decode85Byte (src[0 ]) + 85 *(Decode85Byte (src[1 ]) + 85 *(Decode85Byte (src[2 ]) + 85 *(Decode85Byte (src[3 ]) + 85 *Decode85Byte (src[4 ]))));
1172
- dst[0 ] = ((tmp >> 0 ) & 0xFF ); dst[1 ] = ((tmp >> 8 ) & 0xFF ); dst[2 ] = ((tmp >> 16 ) & 0xFF ); dst[3 ] = ((tmp >> 24 ) & 0xFF ); // We can't assume little-endianess .
1172
+ dst[0 ] = ((tmp >> 0 ) & 0xFF ); dst[1 ] = ((tmp >> 8 ) & 0xFF ); dst[2 ] = ((tmp >> 16 ) & 0xFF ); dst[3 ] = ((tmp >> 24 ) & 0xFF ); // We can't assume little-endianness .
1173
1173
src += 5 ;
1174
1174
dst += 4 ;
1175
1175
}
0 commit comments