Fixed particle blending.
This commit is contained in:
parent
56982d4e9b
commit
ae2906ca83
4 changed files with 39 additions and 45 deletions
|
@ -52,7 +52,7 @@ class AwIffConvTransp
|
|||
if (*pCol == iTranspCol) return rawTranspCol;
|
||||
unsigned rv = AwIffConvNonTransp::DoConv(pCol,pPalette db_code1(DB_COMMA nPaletteSize));
|
||||
if (rv != rawTranspCol) return rv;
|
||||
|
||||
|
||||
// make the colour non-transparent (nb: only an occasional case)
|
||||
|
||||
// OK, Here's the plan:
|
||||
|
@ -100,15 +100,7 @@ class AwIffConvTransp
|
|||
: (1<<pixelFormat.blueRightShift )*3/2 - (pPalette[*pCol].b & (1<<pixelFormat.blueRightShift )-1));
|
||||
|
||||
// Pick lowest value and do the business
|
||||
|
||||
Colour colAdj = pPalette[*pCol];
|
||||
|
||||
#if defined(_MSC_VER) && _MSC_VER >= 1100
|
||||
// VC5.0 gives inane warnings when += type operators
|
||||
// are used on types smaller than int (even with
|
||||
// explicit casting!)
|
||||
#pragma warning(disable:4244)
|
||||
#endif
|
||||
if
|
||||
(
|
||||
nBlueDiffUp <= nBlueDiffDown
|
||||
|
@ -155,12 +147,6 @@ class AwIffConvTransp
|
|||
{
|
||||
colAdj.g -= static_cast<unsigned char>(1<<pixelFormat.greenRightShift);
|
||||
}
|
||||
#if defined(_MSC_VER) && _MSC_VER == 1100
|
||||
// VC5.0 gives inane warnings when += type operators
|
||||
// are used on types smaller than int (even with
|
||||
// explicit casting!)
|
||||
#pragma warning(default:4244)
|
||||
#endif
|
||||
|
||||
return Colour::ConvNonTransp::DoConv(&colAdj);
|
||||
}
|
||||
|
|
|
@ -432,10 +432,8 @@ void AwBackupTexture::ChoosePixelFormat(AwTl::CreateTextureParms const & _parmsR
|
|||
// transparency?
|
||||
m_bTranspMask = HasTransparentMask(fMyFlags & AW_TLF_TRANSP ? true : false);
|
||||
|
||||
|
||||
if (_parmsR.loadTextureB || fMyFlags & AW_TLF_TEXTURE)
|
||||
{
|
||||
fprintf(stderr, "AwBackupTexture::ChoosePixelFormat(...)\n");
|
||||
#if 0
|
||||
// use a texture format
|
||||
unsigned nColours = GetNumColours();
|
||||
|
@ -445,7 +443,7 @@ void AwBackupTexture::ChoosePixelFormat(AwTl::CreateTextureParms const & _parmsR
|
|||
|
||||
for (LIF<AdditionalPixelFormat> itFormat(&listTextureFormats); !itFormat.done(); itFormat.next())
|
||||
{
|
||||
AdditionalPixelFormat const * pThisFormat = &itFormat();
|
||||
AdditionalPixelFormat * pThisFormat = &itFormat();
|
||||
// is this format suitable?
|
||||
// ignoring alpha for now
|
||||
if
|
||||
|
@ -495,12 +493,12 @@ void AwBackupTexture::ChoosePixelFormat(AwTl::CreateTextureParms const & _parmsR
|
|||
{
|
||||
// use display surface format
|
||||
pixelFormat = pfSurfaceFormat;
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Just convert the texture to 32bpp */
|
||||
/* Just convert the texture to 32bpp */
|
||||
pixelFormat.palettizedB = 0;
|
||||
pixelFormat.alphaB = 0;
|
||||
|
||||
pixelFormat.alphaB = 1;
|
||||
pixelFormat.validB = 1;
|
||||
pixelFormat.bitsPerPixel = 32;
|
||||
pixelFormat.redLeftShift = 0;
|
||||
|
@ -509,8 +507,8 @@ void AwBackupTexture::ChoosePixelFormat(AwTl::CreateTextureParms const & _parmsR
|
|||
pixelFormat.redRightShift = 0;
|
||||
pixelFormat.greenRightShift = 0;
|
||||
pixelFormat.blueRightShift = 0;
|
||||
pixelFormat.dwRGBAlphaBitMask = 0x00000000;
|
||||
|
||||
pixelFormat.dwRGBAlphaBitMask = 0xFF000000;
|
||||
}
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
|
@ -569,7 +567,7 @@ AwTl::SurfUnion AwBackupTexture::CreateTexture(AwTl::CreateTextureParms const &
|
|||
++y;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/* temp junk */
|
||||
Tex->w = m_nWidth;
|
||||
Tex->h = m_nHeight;
|
||||
|
@ -1404,7 +1402,7 @@ void AwBackupTexture::ConvertRow(AwTl::PtrUnion pDest, unsigned nDestWidth, AwTl
|
|||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
{
|
||||
if (m_bTranspMask)
|
||||
GenericConvertRow<Colour::ConvTransp,Colour>::Do(pDest,nDestWidth,pSrc.colourP+nSrcOffset,nSrcWidth);
|
||||
else
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue