From 5673c1665a2c6d7fdaf1a20d554bb135a20c7bc8 Mon Sep 17 00:00:00 2001 From: Steven Fuller Date: Fri, 5 May 2017 12:00:00 +0200 Subject: Import icculus.org release (2017-05-05) --- src/win95/awtexld.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'src/win95/awtexld.cpp') diff --git a/src/win95/awtexld.cpp b/src/win95/awtexld.cpp index 64afca7..ac9d857 100644 --- a/src/win95/awtexld.cpp +++ b/src/win95/awtexld.cpp @@ -145,8 +145,7 @@ namespace AwTl DWORD memFlag; void * ddP; - } - driverDesc; + } driverDesc; /*************************************************************************/ /* Class used to hold all the parameters for the CreateTexture functions */ @@ -496,6 +495,9 @@ void AwBackupTexture::ChoosePixelFormat(AwTl::CreateTextureParms const & _parmsR #endif /* Just convert the texture to 32bpp */ + // may want to support paletted textures + // at some point; at which point, should + // push texture conversion into the opengl layer pixelFormat.palettizedB = 0; pixelFormat.alphaB = 1; @@ -540,7 +542,15 @@ AwTl::SurfUnion AwBackupTexture::CreateTexture(AwTl::CreateTextureParms const & fprintf(stderr, "AwBackupTexture::CreateTexture - chroma\n"); } + if (pixelFormat.texB && m_bTranspMask) { + //fprintf(stderr, "AwBackupTexture::CreateTexture - transparency\n"); + } + // convert asset to 32-bit rgba + // may want to support paletted textures + // at some point; at which point, should + // push texture conversion into the opengl layer + unsigned char *buf = (unsigned char *)malloc(m_nWidth * m_nHeight * 4); Colour * paletteP = m_nPaletteSize ? GetPalette() : NULL; @@ -591,6 +601,8 @@ AwTl::SurfUnion AwBackupTexture::CreateTexture(AwTl::CreateTextureParms const & Tex->w = m_nWidth; Tex->h = m_nHeight; + Tex->hasAlpha = m_bTranspMask; + Tex->hasChroma = m_fFlags & AW_TLF_CHROMAKEY; if (pixelFormat.texB) { CreateOGLTexture(Tex, buf); -- cgit v1.3