- renamed some fixed point stuff in the texture composition code.
This commit is contained in:
parent
86d1b2955a
commit
5bf806e478
5 changed files with 35 additions and 25 deletions
|
|
@ -180,7 +180,7 @@ protected:
|
|||
FRemapTable *Translation;
|
||||
PalEntry Blend;
|
||||
FTexture *Texture;
|
||||
fixed_t Alpha;
|
||||
blend_t Alpha;
|
||||
|
||||
TexPart();
|
||||
};
|
||||
|
|
@ -593,7 +593,7 @@ int FMultiPatchTexture::CopyTrueColorPixels(FBitmap *bmp, int x, int y, int rota
|
|||
|
||||
memset (&info, 0, sizeof(info));
|
||||
info.alpha = Parts[i].Alpha;
|
||||
info.invalpha = OPAQUE - info.alpha;
|
||||
info.invalpha = BLENDUNIT - info.alpha;
|
||||
info.op = ECopyOp(Parts[i].op);
|
||||
PalEntry b = Parts[i].Blend;
|
||||
if (b.a == 0 && b != BLEND_NONE)
|
||||
|
|
@ -604,14 +604,14 @@ int FMultiPatchTexture::CopyTrueColorPixels(FBitmap *bmp, int x, int y, int rota
|
|||
{
|
||||
if (b.a == 255)
|
||||
{
|
||||
info.blendcolor[0] = b.r * FRACUNIT / 255;
|
||||
info.blendcolor[1] = b.g * FRACUNIT / 255;
|
||||
info.blendcolor[2] = b.b * FRACUNIT / 255;
|
||||
info.blendcolor[0] = b.r * BLENDUNIT / 255;
|
||||
info.blendcolor[1] = b.g * BLENDUNIT / 255;
|
||||
info.blendcolor[2] = b.b * BLENDUNIT / 255;
|
||||
info.blend = BLEND_MODULATE;
|
||||
}
|
||||
else
|
||||
{
|
||||
fixed_t blendalpha = b.a * FRACUNIT / 255;
|
||||
blend_t blendalpha = b.a * BLENDUNIT / 255;
|
||||
info.blendcolor[0] = b.r * blendalpha;
|
||||
info.blendcolor[1] = b.g * blendalpha;
|
||||
info.blendcolor[2] = b.b * blendalpha;
|
||||
|
|
@ -1165,7 +1165,7 @@ void FMultiPatchTexture::ParsePatch(FScanner &sc, TexPart & part, bool silent, i
|
|||
else if (sc.Compare("alpha"))
|
||||
{
|
||||
sc.MustGetFloat();
|
||||
part.Alpha = clamp<fixed_t>(FLOAT2FIXED(sc.Float), 0, OPAQUE);
|
||||
part.Alpha = clamp<blend_t>(int(sc.Float / BLENDUNIT), 0, BLENDUNIT);
|
||||
// bComplex is not set because it is only needed when the style is not OP_COPY.
|
||||
}
|
||||
else if (sc.Compare("style"))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue