- always store 255 in alpha channel for opaque things as the alpha channel is no longer ignored by the framebuffer backend (software drawer)

This commit is contained in:
Magnus Norddahl 2018-04-15 14:58:19 +02:00
parent 11bb626ab6
commit 25784c2e57
6 changed files with 6 additions and 0 deletions

View file

@ -371,6 +371,7 @@ namespace swrenderer
if (BlendT::Mode == (int)SpanBlendModes::Opaque) if (BlendT::Mode == (int)SpanBlendModes::Opaque)
{ {
fgcolor.a = 255;
return fgcolor; return fgcolor;
} }
else if (BlendT::Mode == (int)SpanBlendModes::Masked) else if (BlendT::Mode == (int)SpanBlendModes::Masked)

View file

@ -414,6 +414,7 @@ namespace swrenderer
{ {
__m128i outcolor = fgcolor; __m128i outcolor = fgcolor;
outcolor = _mm_packus_epi16(outcolor, _mm_setzero_si128()); outcolor = _mm_packus_epi16(outcolor, _mm_setzero_si128());
outcolor = _mm_or_si128(outcolor, _mm_set1_epi32(0xff000000));
return outcolor; return outcolor;
} }
else if (BlendT::Mode == (int)SpanBlendModes::Masked) else if (BlendT::Mode == (int)SpanBlendModes::Masked)

View file

@ -322,6 +322,7 @@ namespace swrenderer
if (BlendT::Mode == (int)SpriteBlendModes::Opaque) if (BlendT::Mode == (int)SpriteBlendModes::Opaque)
{ {
fgcolor.a = 255;
return fgcolor; return fgcolor;
} }
else if (BlendT::Mode == (int)SpriteBlendModes::Shaded) else if (BlendT::Mode == (int)SpriteBlendModes::Shaded)

View file

@ -368,6 +368,7 @@ namespace swrenderer
{ {
__m128i outcolor = fgcolor; __m128i outcolor = fgcolor;
outcolor = _mm_packus_epi16(outcolor, _mm_setzero_si128()); outcolor = _mm_packus_epi16(outcolor, _mm_setzero_si128());
outcolor = _mm_or_si128(outcolor, _mm_set1_epi32(0xff000000));
return outcolor; return outcolor;
} }
else if (BlendT::Mode == (int)SpriteBlendModes::Shaded) else if (BlendT::Mode == (int)SpriteBlendModes::Shaded)

View file

@ -285,6 +285,7 @@ namespace swrenderer
if (BlendT::Mode == (int)WallBlendModes::Opaque) if (BlendT::Mode == (int)WallBlendModes::Opaque)
{ {
fgcolor.a = 255;
return fgcolor; return fgcolor;
} }
else if (BlendT::Mode == (int)WallBlendModes::Masked) else if (BlendT::Mode == (int)WallBlendModes::Masked)

View file

@ -330,6 +330,7 @@ namespace swrenderer
{ {
__m128i outcolor = fgcolor; __m128i outcolor = fgcolor;
outcolor = _mm_packus_epi16(outcolor, _mm_setzero_si128()); outcolor = _mm_packus_epi16(outcolor, _mm_setzero_si128());
outcolor = _mm_or_si128(outcolor, _mm_set1_epi32(0xff000000));
return outcolor; return outcolor;
} }
else if (BlendT::Mode == (int)WallBlendModes::Masked) else if (BlendT::Mode == (int)WallBlendModes::Masked)