@@ -480,32 +480,24 @@ static void DrawTriangle3D(Vertex* V0, Vertex* V1, Vertex* V2) {
480480 }
481481
482482 if (gfx_alphaTest && A == 0 ) return ;
483- color = BitmapCol_Make (R , G , B , 0xFF );
484-
485- for (y = minY ; y <= maxY ; y ++ , bc0_start += dy12 , bc1_start += dy20 , bc2_start += dy01 )
486- {
487- int bc0 = bc0_start ;
488- int bc1 = bc1_start ;
489- int bc2 = bc2_start ;
490-
491- for (x = minX ; x <= maxX ; x ++ , bc0 += dx12 , bc1 += dx20 , bc2 += dx01 )
492- {
493- if ((bc0 | bc1 | bc2 ) < 0 ) continue ;
494- int cb_index = y * cb_stride + x ;
495-
496- if (!gfx_alphaBlend ) {
497- colorBuffer [cb_index ] = color ;
498- continue ;
499- }
483+
500484
501- // Hardcode for alpha of 128
502- BitmapCol dst = colorBuffer [cb_index ];
503- int finR = (R + BitmapCol_R (dst )) >> 1 ;
504- int finG = (G + BitmapCol_G (dst )) >> 1 ;
505- int finB = (B + BitmapCol_B (dst )) >> 1 ;
485+ if (!gfx_alphaBlend ) {
486+ #define PIXEL_PLOT_FUNC (index , x , y ) \
487+ colorBuffer[index] = color;
506488
507- colorBuffer [cb_index ] = BitmapCol_Make (finR , finG , finB , 0xFF );
508- }
489+ color = BitmapCol_Make (R , G , B , 0xFF );
490+ #include "Graphics_SoftMin.tri.i"
491+ } else {
492+ // Hardcode for alpha of 128
493+ #define PIXEL_PLOT_FUNC (index , x , y ) \
494+ BitmapCol dst = colorBuffer[index]; \
495+ int finR = (R + BitmapCol_R(dst)) >> 1; \
496+ int finG = (G + BitmapCol_G(dst)) >> 1; \
497+ int finB = (B + BitmapCol_B(dst)) >> 1; \
498+ colorBuffer[index] = BitmapCol_Make(finR, finG, finB, 0xFF);
499+
500+ #include "Graphics_SoftMin.tri.i"
509501 }
510502}
511503
0 commit comments