- Changed FMultiPatchTexture::CopyTrueColorPixels() so that all parts use their copy info.

Previously, "complex" parts would ignore it and use the copy info passed to the function
  instead. The copy info passed to the function is now only used to decide to if it should clear
  the destination image. I'm not sure if this really matters, since it itself is the only place aside
  from FTexture::FillBuffer() that ever calls CopyTrueColorPixels() with a copy info, and when
  it does so for a multipatch texture, it does so to a temporary buffer.

SVN r3634 (trunk)
This commit is contained in:
Randy Heit 2012-05-10 03:07:30 +00:00
parent 60dc67d5c3
commit 9340dc4eca

View file

@ -573,19 +573,10 @@ int FMultiPatchTexture::CopyTrueColorPixels(FBitmap *bmp, int x, int y, int rota
// rotated multipatch parts cannot be composited directly // rotated multipatch parts cannot be composited directly
bool rotatedmulti = Parts[i].Rotate != 0 && Parts[i].Texture->bMultiPatch; bool rotatedmulti = Parts[i].Rotate != 0 && Parts[i].Texture->bMultiPatch;
if ((!Parts[i].Texture->bComplex || inf == NULL) && !rotatedmulti)
{
memset (&info, 0, sizeof (info)); memset (&info, 0, sizeof (info));
info.alpha = Parts[i].Alpha; info.alpha = Parts[i].Alpha;
info.invalpha = FRACUNIT - info.alpha; info.invalpha = FRACUNIT - info.alpha;
info.op = ECopyOp(Parts[i].op); info.op = ECopyOp(Parts[i].op);
if (Parts[i].Translation != NULL)
{
// Using a translation forces downconversion to the base palette
ret = Parts[i].Texture->CopyTrueColorTranslated(bmp, x+Parts[i].OriginX, y+Parts[i].OriginY, Parts[i].Rotate, Parts[i].Translation, &info);
}
else
{
PalEntry b = Parts[i].Blend; PalEntry b = Parts[i].Blend;
if (b.a == 0 && b != BLEND_NONE) if (b.a == 0 && b != BLEND_NONE)
{ {
@ -610,6 +601,16 @@ int FMultiPatchTexture::CopyTrueColorPixels(FBitmap *bmp, int x, int y, int rota
info.blend = BLEND_OVERLAY; info.blend = BLEND_OVERLAY;
} }
} }
if ((!Parts[i].Texture->bComplex || inf == NULL) && !rotatedmulti)
{
if (Parts[i].Translation != NULL)
{
// Using a translation forces downconversion to the base palette
ret = Parts[i].Texture->CopyTrueColorTranslated(bmp, x+Parts[i].OriginX, y+Parts[i].OriginY, Parts[i].Rotate, Parts[i].Translation, &info);
}
else
{
ret = Parts[i].Texture->CopyTrueColorPixels(bmp, x+Parts[i].OriginX, y+Parts[i].OriginY, Parts[i].Rotate, &info); ret = Parts[i].Texture->CopyTrueColorPixels(bmp, x+Parts[i].OriginX, y+Parts[i].OriginY, Parts[i].Rotate, &info);
} }
} }
@ -625,7 +626,7 @@ int FMultiPatchTexture::CopyTrueColorPixels(FBitmap *bmp, int x, int y, int rota
bmp1.Zero(); bmp1.Zero();
Parts[i].Texture->CopyTrueColorPixels(&bmp1, 0, 0); Parts[i].Texture->CopyTrueColorPixels(&bmp1, 0, 0);
bmp->CopyPixelDataRGB(x+Parts[i].OriginX, y+Parts[i].OriginY, bmp1.GetPixels(), bmp->CopyPixelDataRGB(x+Parts[i].OriginX, y+Parts[i].OriginY, bmp1.GetPixels(),
bmp1.GetWidth(), bmp1.GetHeight(), 4, bmp1.GetPitch(), Parts[i].Rotate, CF_BGRA, inf); bmp1.GetWidth(), bmp1.GetHeight(), 4, bmp1.GetPitch(), Parts[i].Rotate, CF_BGRA, &info);
} }
} }