- Fixed: paletted texture composition with part translucent patches
did not work. SVN r1771 (trunk)
This commit is contained in:
parent
385350efae
commit
fe96cab254
2 changed files with 16 additions and 15 deletions
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue