TINYGL: Treat alpha the same way as other color components.
When kLightsMode (aka kInterpRGB) is false, "a" is always 0 (vertice data is not used in caller in corresponding branches), so taking it into account makes all triangles transparent. This is not visible in practice, because putPixelTextureMappingPerspective is only called when (kInterpST || kInterpSTZ) is true, and kInterpRGB is always true when that's the case. But unifying color processing allows further code simplification.
This commit is contained in:
parent
0065f38251
commit
369332e464
1 changed files with 2 additions and 2 deletions
|
@ -91,12 +91,12 @@ FORCEINLINE static void putPixelTextureMappingPerspective(FrameBuffer *buffer, i
|
|||
c_r = (col >> textureFormat.rShift) & 0xFF;
|
||||
c_g = (col >> textureFormat.gShift) & 0xFF;
|
||||
c_b = (col >> textureFormat.bShift) & 0xFF;
|
||||
unsigned int l_a = (a / 256);
|
||||
c_a = (c_a * l_a) / 256;
|
||||
if (kLightsMode) {
|
||||
unsigned int l_a = (a / 256);
|
||||
unsigned int l_r = (r / 256);
|
||||
unsigned int l_g = (g / 256);
|
||||
unsigned int l_b = (b / 256);
|
||||
c_a = (c_a * l_a) / 256;
|
||||
c_r = (c_r * l_r) / 256;
|
||||
c_g = (c_g * l_g) / 256;
|
||||
c_b = (c_b * l_b) / 256;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue