diff options
| author | Steven Fuller <relnev@icculus.org> | 2017-05-05 12:00:00 +0200 |
|---|---|---|
| committer | Patryk Obara <dreamer.tan@gmail.com> | 2019-08-20 03:51:51 +0200 |
| commit | 5673c1665a2c6d7fdaf1a20d554bb135a20c7bc8 (patch) | |
| tree | ccf08c484f14d7c5e95fa7f645db2014d61ebb78 /src/win95/awtexld.cpp | |
| parent | 0de664d0a886bcda45a0cd05551b6896c5c46ed0 (diff) | |
Import icculus.org release (2017-05-05)
Diffstat (limited to 'src/win95/awtexld.cpp')
| -rw-r--r-- | src/win95/awtexld.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
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); |
