From 5ffe177543c72abb55a2473eae678c71895003fc Mon Sep 17 00:00:00 2001 From: Lionel Ulmer Date: Mon, 2 Aug 2004 18:24:04 +0000 Subject: [PATCH] - Fix compilation on boxes without OpenGL installed. - Print the warning message only once. --- dlls/ddraw/ddraw/main.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/dlls/ddraw/ddraw/main.c b/dlls/ddraw/ddraw/main.c index 80d0df4c75c..a0b7a012168 100644 --- a/dlls/ddraw/ddraw/main.c +++ b/dlls/ddraw/ddraw/main.c @@ -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)) {