- Fixed: paletted texture composition with part translucent patches

did not work.


SVN r1771 (trunk)
This commit is contained in:
Christoph Oelckers 2009-08-12 22:10:53 +00:00
parent 385350efae
commit fe96cab254
2 changed files with 19 additions and 18 deletions

View file

@ -1,4 +1,6 @@
August 12, 2009 (Changes by Graf Zahl)
- Fixed: paletted texture composition with part translucent patches
did not work.
- Fixed: A_SorcOffense2 depended on args being bytes and overflowing.
- Fixed: Even though P_DamageMobj checked an attack's originator
for MF2_NODMGTHRUST the same check was missing from P_RadiusAttack.

View file

@ -494,31 +494,30 @@ void FMultiPatchTexture::MakeTexture ()
Pixels = new BYTE[numpix];
memset (Pixels, 0, numpix);
// This is not going to be easy for paletted output. Using the
// real time mixing tables gives results that just look bad and
// downconverting a true color image also has its problems so the only
// real choice is to do normal compositing with any translucent patch
// just masking the affected pixels, then do a full true color composition
// and merge these pixels in.
for (int i = 0; i < NumParts; ++i)
{
BYTE *trans = Parts[i].Translation ? Parts[i].Translation->Remap : NULL;
if (Parts[i].op != OP_COPY)
{
hasTranslucent = true;
}
else
{
if (Parts[i].Blend != 0)
{
trans = GetBlendMap(Parts[i].Blend, blendwork);
}
Parts[i].Texture->CopyToBlock (Pixels, Width, Height,
Parts[i].OriginX, Parts[i].OriginY, Parts[i].Rotate, trans);
}
}
if (hasTranslucent)
if (!hasTranslucent)
{
for (int i = 0; i < NumParts; ++i)
{
BYTE *trans = Parts[i].Translation ? Parts[i].Translation->Remap : NULL;
{
if (Parts[i].Blend != 0)
{
trans = GetBlendMap(Parts[i].Blend, blendwork);
}
Parts[i].Texture->CopyToBlock (Pixels, Width, Height,
Parts[i].OriginX, Parts[i].OriginY, Parts[i].Rotate, trans);
}
}
}
else
{
// In case there are translucent patches let's do the composition in
// True color to keep as much precision as possible before downconverting to the palette.
@ -1120,7 +1119,7 @@ void FMultiPatchTexture::ParsePatch(FScanner &sc, TexPart & part)
static const char *styles[] = {"copy", "translucent", "add", "subtract", "reversesubtract", "modulate", "copyalpha", NULL };
sc.MustGetString();
part.op = sc.MustMatchString(styles);
bComplex = (part.op != OP_COPY);
bComplex |= (part.op != OP_COPY);
bTranslucentPatches = bComplex;
}
}