- Fix compilation on boxes without OpenGL installed.

- Print the warning message only once.
This commit is contained in:
Lionel Ulmer 2004-08-02 18:24:04 +00:00 committed by Alexandre Julliard
parent eac96b5606
commit 5ffe177543
1 changed files with 13 additions and 2 deletions

View File

@ -380,6 +380,7 @@ create_texture(IDirectDrawImpl* This, const DDSURFACEDESC2 *pDDSD,
ddsd.u4.ddpfPixelFormat = This->pixelformat;
}
#ifdef HAVE_OPENGL
/* We support for now only DXT1, DXT3 & DXT5 compressed texture formats... */
if ((ddsd.u4.ddpfPixelFormat.dwFlags & DDPF_FOURCC) &&
(ddsd.u4.ddpfPixelFormat.dwFourCC != MAKE_FOURCC('D','X','T','1')) &&
@ -392,10 +393,20 @@ create_texture(IDirectDrawImpl* This, const DDSURFACEDESC2 *pDDSD,
/* Check if we can really support DXT1, DXT3 & DXT5 */
if ((ddsd.u4.ddpfPixelFormat.dwFlags & DDPF_FOURCC) &&
!GL_extensions.s3tc_compressed_texture && !s3tc_initialized) {
ERR("Trying to create DXT1, DXT3 or DXT5 texture which is not supported by the video card!!!\n");
ERR("However there is a library libtxc_dxtn.so that can be used to do the software decompression...\n");
static BOOLEAN user_warned = 0;
if (user_warned == 0) {
ERR("Trying to create DXT1, DXT3 or DXT5 texture which is not supported by the video card!!!\n");
ERR("However there is a library libtxc_dxtn.so that can be used to do the software decompression...\n");
user_warned = 1;
}
return DDERR_INVALIDPIXELFORMAT;
}
#else
if (ddsd.u4.ddpfPixelFormat.dwFlags & DDPF_FOURCC)
{
return DDERR_INVALIDPIXELFORMAT;
}
#endif
if (!(ddsd.dwFlags & DDSD_PITCH))
{