diff options
| author | Steven Fuller <relnev@icculus.org> | 2001-12-06 00:22:46 +0000 |
|---|---|---|
| committer | Patryk Obara <dreamer.tan@gmail.com> | 2019-08-20 02:22:36 +0200 |
| commit | 9f006f18fe497c1ef12cd2973045fadbd500aaac (patch) | |
| tree | fab2f2562efbcfa83188797a966b32bd5810d7cc /src/win95/awtexld.cpp | |
| parent | 4508748944c293618d775e346c998f025cf6d1cd (diff) | |
Many warnings cleaned up (Tim Beckmann)
Menus.
Diffstat (limited to 'src/win95/awtexld.cpp')
| -rw-r--r-- | src/win95/awtexld.cpp | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/src/win95/awtexld.cpp b/src/win95/awtexld.cpp index 3394374..337e1d0 100644 --- a/src/win95/awtexld.cpp +++ b/src/win95/awtexld.cpp @@ -500,6 +500,7 @@ void AwBackupTexture::ChoosePixelFormat(AwTl::CreateTextureParms const & _parmsR pixelFormat.alphaB = 1; pixelFormat.validB = 1; + pixelFormat.texB = 1; pixelFormat.bitsPerPixel = 32; pixelFormat.redLeftShift = 0; pixelFormat.greenLeftShift = 8; @@ -513,6 +514,7 @@ void AwBackupTexture::ChoosePixelFormat(AwTl::CreateTextureParms const & _parmsR extern "C" { extern int CreateOGLTexture(D3DTexture *, unsigned char *); +extern int CreateIMGSurface(D3DTexture *, unsigned char *); }; AwTl::SurfUnion AwBackupTexture::CreateTexture(AwTl::CreateTextureParms const & _parmsR) @@ -520,8 +522,11 @@ AwTl::SurfUnion AwBackupTexture::CreateTexture(AwTl::CreateTextureParms const & using namespace AwTl; // fprintf(stderr, "AwBackupTexture::CreateTexture(...) This is where we could convert the image to RGB/RGBA, and so on\n"); + + if (_parmsR.originalWidthP) *_parmsR.originalWidthP = m_nWidth; + if (_parmsR.originalHeightP) *_parmsR.originalHeightP = m_nHeight; - D3DTexture *Tex = new D3DTexture; + D3DTexture *Tex = (D3DTexture *)malloc(sizeof(D3DTexture)); unsigned char *buf = (unsigned char *)malloc(m_nWidth * m_nHeight * 4); @@ -571,9 +576,15 @@ AwTl::SurfUnion AwBackupTexture::CreateTexture(AwTl::CreateTextureParms const & /* temp junk */ Tex->w = m_nWidth; Tex->h = m_nHeight; - CreateOGLTexture(Tex, buf); /* this will set the id */ - free(buf); - + if (pixelFormat.texB) { + Tex->buf = NULL; /* not used */ + CreateOGLTexture(Tex, buf); /* this will set the id */ + free(buf); + } else { + Tex->buf = buf; /* hey, I need this! */ + CreateIMGSurface(Tex, buf); + } + return static_cast<SurfUnion>(Tex); #if 0 @@ -2154,6 +2165,7 @@ DDSurface * AwCreateSurface(char const * _argFormatS, ...) pixelFormat.alphaB = 1; pixelFormat.validB = 1; + pixelFormat.texB = 0; pixelFormat.bitsPerPixel = 32; pixelFormat.redLeftShift = 0; pixelFormat.greenLeftShift = 8; |
