From 297a301f3574903e617008f4f0233092547d73f1 Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Sat, 20 Sep 2014 03:18:27 +0200 Subject: [PATCH] =?UTF-8?q?Added=20patch=20to=20implement=20software=20dec?= =?UTF-8?q?oding/encoding=20of=20DXT1=20textures=20(by=20Michael=20M=C3=BC?= =?UTF-8?q?ller).?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since we have a lot of changes to configure.ac, we need to get rid of a bit context in order to apply them in arbitrary order. --- README.md | 3 +- debian/changelog | 1 + patches/Makefile | 20 + ...retrieving-DOS-attributes-in-NtQuery.patch | 6 +- ...ort-for-DXTn-software-decoding-throu.patch | 418 ++++++++++++++++++ patches/wined3d-DXTn/definition | 4 + ...-initial-stub-for-pulseaudio-support.patch | 4 +- 7 files changed, 447 insertions(+), 9 deletions(-) create mode 100644 patches/wined3d-DXTn/0001-wined3d-Add-support-for-DXTn-software-decoding-throu.patch create mode 100644 patches/wined3d-DXTn/definition diff --git a/README.md b/README.md index b5d9538d..8387d99c 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ Wine. All those differences are also documented on the Included bugfixes and improvements ================================== -**Bugfixes and features included in the next upcoming release [7]:** +**Bugfixes and features included in the next upcoming release [8]:** * Don't fill KdHelp structure for usermode applications ([Wine Bug #37272](http://bugs.winehq.org/show_bug.cgi?id=37272 "CheatEngine 6.4 fails after remote process 'breakin', reporting 'Debugger Crash:Access violation (Last location:41)'")) * Fix black screen on startup introduced by pixelformat changes. ([Wine Bug #35950](http://bugs.winehq.org/show_bug.cgi?id=35950 "StarCraft: Black screen, hangs on startup")) @@ -43,6 +43,7 @@ Included bugfixes and improvements * Fix gray screen on startup introduced by pixelformat changes. ([Wine Bug #35975](http://bugs.winehq.org/show_bug.cgi?id=35975 "Comanche 3 shows only gray screen")) * Fix missing video introduced by pixelformat changes. ([Wine Bug #36900](http://bugs.winehq.org/show_bug.cgi?id=36900 "Star Wars Galactic Battlegrounds Clone Campaigns: no video (regression)")) * Fix wined3d performance drop introduced by pixelformat changes. ([Wine Bug #35655](http://bugs.winehq.org/show_bug.cgi?id=35655 "Wined3d performance drop")) +* Lego Stunt Rally requires DXTn software de/encoding support ([Wine Bug #25486](http://bugs.winehq.org/show_bug.cgi?id=25486 "Lego Stunt Rally: 3d scene is black")) * Support for FIND_FIRST_EX_LARGE_FETCH flag in FindFirstFileExW ([Wine Bug #35121](http://bugs.winehq.org/show_bug.cgi?id=35121 "Multiple applications/games fail to start with WinVer set to 'Windows 7' (FindFirstFileExW needs FIND_FIRST_EX_LARGE_FETCH support)(FotoQuelle Fotosoftware v4.13, QT5)")) diff --git a/debian/changelog b/debian/changelog index 47d4aa25..c01e0983 100644 --- a/debian/changelog +++ b/debian/changelog @@ -5,6 +5,7 @@ wine-compholio (1.7.27) UNRELEASED; urgency=low * Added patch to avoid filling out KdHelp for usermode applications. * Added patch to silence repeated GSUB_apply_ChainContext[Subst|Pos] FIXMEs. * Added patch to revert wined3d pixelformat changes (causes regression in many games). + * Added patch to implement software decoding/encoding of DXT1 textures. * Removed patch to use assembly wrapper for TLS callbacks (accepted upstream). * Removed patch to fix uninitialized cch struct member in GetMenuItemInfo (accepted upstream). * Removed some patches for riched20/IText*-interface (accepted upstream). diff --git a/patches/Makefile b/patches/Makefile index 96f6b1c9..87ff4cca 100644 --- a/patches/Makefile +++ b/patches/Makefile @@ -68,6 +68,7 @@ PATCHLIST := \ user32-WndProc.ok \ wineboot-HKEY_DYN_DATA.ok \ winebuild-LinkerVersion.ok \ + wined3d-DXTn.ok \ wined3d-Revert_PixelFormat.ok \ winepulse-PulseAudio_Support.ok \ winex11-Limited_Resolutions.ok \ @@ -1081,6 +1082,25 @@ winebuild-LinkerVersion.ok: echo '+ { "winebuild-LinkerVersion", "Michael Müller", "Set a valid major and minor linker version in the PE header." },'; \ ) > winebuild-LinkerVersion.ok +# Patchset wined3d-DXTn +# | +# | Included patches: +# | * Add support for DXTn software decoding through libxtc_dxtn. [by Michael Müller] +# | +# | This patchset fixes the following Wine bugs: +# | * [#25486] Lego Stunt Rally requires DXTn software de/encoding support +# | +# | Modified files: +# | * configure.ac, dlls/wined3d/Makefile.in, dlls/wined3d/dxtn.c, dlls/wined3d/surface.c, dlls/wined3d/wined3d_main.c, +# | dlls/wined3d/wined3d_private.h +# | +.INTERMEDIATE: wined3d-DXTn.ok +wined3d-DXTn.ok: + $(call APPLY_FILE,wined3d-DXTn/0001-wined3d-Add-support-for-DXTn-software-decoding-throu.patch) + @( \ + echo '+ { "wined3d-DXTn", "Michael Müller", "Add support for DXTn software decoding through libxtc_dxtn." },'; \ + ) > wined3d-DXTn.ok + # Patchset wined3d-Revert_PixelFormat # | # | Included patches: diff --git a/patches/ntdll-DOS_Attributes/0002-ntdll-Implement-retrieving-DOS-attributes-in-NtQuery.patch b/patches/ntdll-DOS_Attributes/0002-ntdll-Implement-retrieving-DOS-attributes-in-NtQuery.patch index 10cd7061..2e9cc685 100644 --- a/patches/ntdll-DOS_Attributes/0002-ntdll-Implement-retrieving-DOS-attributes-in-NtQuery.patch +++ b/patches/ntdll-DOS_Attributes/0002-ntdll-Implement-retrieving-DOS-attributes-in-NtQuery.patch @@ -17,14 +17,10 @@ diff --git a/configure.ac b/configure.ac index 7de7a87..b77c12f 100644 --- a/configure.ac +++ b/configure.ac -@@ -75,6 +75,7 @@ AC_ARG_WITH(pthread, AS_HELP_STRING([--without-pthread],[do not use the pthrea - AC_ARG_WITH(sane, AS_HELP_STRING([--without-sane],[do not use SANE (scanner support)])) - AC_ARG_WITH(tiff, AS_HELP_STRING([--without-tiff],[do not use TIFF])) +@@ -77,2 +77,3 @@ AC_ARG_WITH(tiff, AS_HELP_STRING([--without-tiff],[do not use TIFF])) AC_ARG_WITH(v4l, AS_HELP_STRING([--without-v4l],[do not use v4l1 (v4l support)])) +AC_ARG_WITH(xattr, AS_HELP_STRING([--without-xattr],[do not use xattr (security attributes support)])) AC_ARG_WITH(xcomposite,AS_HELP_STRING([--without-xcomposite],[do not use the Xcomposite extension]), - [if test "x$withval" = "xno"; then ac_cv_header_X11_extensions_Xcomposite_h=no; fi]) - AC_ARG_WITH(xcursor, AS_HELP_STRING([--without-xcursor],[do not use the Xcursor extension]), @@ -667,6 +668,17 @@ AC_CHECK_HEADERS([libprocstat.h],,, #include #endif]) diff --git a/patches/wined3d-DXTn/0001-wined3d-Add-support-for-DXTn-software-decoding-throu.patch b/patches/wined3d-DXTn/0001-wined3d-Add-support-for-DXTn-software-decoding-throu.patch new file mode 100644 index 00000000..70e320e7 --- /dev/null +++ b/patches/wined3d-DXTn/0001-wined3d-Add-support-for-DXTn-software-decoding-throu.patch @@ -0,0 +1,418 @@ +From b51c739540f15a1d3a809d01ced465879c1c4425 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michael=20M=C3=BCller?= +Date: Sat, 20 Sep 2014 02:48:07 +0200 +Subject: wined3d: Add support for DXTn software decoding through libxtc_dxtn. + +--- + configure.ac | 9 ++ + dlls/wined3d/Makefile.in | 1 + + dlls/wined3d/dxtn.c | 259 +++++++++++++++++++++++++++++++++++++++++ + dlls/wined3d/surface.c | 42 +++++++ + dlls/wined3d/wined3d_main.c | 5 + + dlls/wined3d/wined3d_private.h | 5 + + 6 files changed, 321 insertions(+) + create mode 100644 dlls/wined3d/dxtn.c + +diff --git a/configure.ac b/configure.ac +index 17ff399..17a67df 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -76,2 +76,3 @@ AC_ARG_WITH(sane, AS_HELP_STRING([--without-sane],[do not use SANE (scanner + AC_ARG_WITH(tiff, AS_HELP_STRING([--without-tiff],[do not use TIFF])) ++AC_ARG_WITH(txc_dxtn, AS_HELP_STRING([--without-txc_dxtn],[do not use txc_dxtn lib (DXTn software support)])) + AC_ARG_WITH(v4l, AS_HELP_STRING([--without-v4l],[do not use v4l1 (v4l support)])) +@@ -1699,6 +1700,14 @@ fi + WINE_NOTICE_WITH(tiff,[test "x$ac_cv_lib_soname_tiff" = "x"], + [libtiff ${notice_platform}development files not found, TIFF won't be supported.]) + ++dnl **** Check for libtxc_dxtn **** ++if test "x$with_txc_dxtn" != "xno" ++then ++ WINE_CHECK_SONAME(txc_dxtn,tx_compress_dxtn,,,,[[libtxc_dxtn\\(_s2tc\\)\\{0,1\\}]]) ++fi ++WINE_NOTICE_WITH(txc_dxtn,[test "x$ac_cv_lib_soname_txc_dxtn" = "x"], ++ [libtxc_dxtn ${notice_platform}development files not found, DXTn software (de)compression won't be supported.]) ++ + dnl **** Check for mpg123 **** + if test "x$with_mpg123" != "xno" + then +diff --git a/dlls/wined3d/Makefile.in b/dlls/wined3d/Makefile.in +index 655800b..ee0615f 100644 +--- a/dlls/wined3d/Makefile.in ++++ b/dlls/wined3d/Makefile.in +@@ -11,6 +11,7 @@ C_SRCS = \ + device.c \ + directx.c \ + drawprim.c \ ++ dxtn.c \ + gl_compat.c \ + glsl_shader.c \ + nvidia_texture_shader.c \ +diff --git a/dlls/wined3d/dxtn.c b/dlls/wined3d/dxtn.c +new file mode 100644 +index 0000000..cffa2aa +--- /dev/null ++++ b/dlls/wined3d/dxtn.c +@@ -0,0 +1,259 @@ ++/* ++ * Copyright 2014 Michael Müller ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA ++ */ ++ ++#include "config.h" ++#include "wine/port.h" ++#include "wined3d_private.h" ++#include "wine/library.h" ++ ++WINE_DEFAULT_DEBUG_CHANNEL(d3d); ++ ++#ifdef SONAME_LIBTXC_DXTN ++ ++static void* txc_dxtn_handle; ++static void (*pfetch_2d_texel_rgba_dxt1)(int srcRowStride, const BYTE *pixData, int i, int j, DWORD *texel); ++static void (*ptx_compress_dxtn)(int comps, int width, int height, const BYTE *srcPixData, ++ GLenum destformat, BYTE *dest, int dstRowStride); ++ ++/* pfetch_2d_texel_rgba_dxt1 doesn't correctly handle pitch - this wrapper should fix it */ ++static inline void dxt1_get_pixel(const BYTE *src, DWORD pitch_in, unsigned int x, unsigned int y, DWORD *color) ++{ ++ const BYTE *src_block = src + (y / 4) * pitch_in + (x / 4) * 8; ++ pfetch_2d_texel_rgba_dxt1(0, src_block, x & 3, y & 3, color); ++} ++ ++static inline BOOL dxt1_to_x8r8g8b8(const BYTE *src, BYTE *dst, ++ DWORD pitch_in, DWORD pitch_out, unsigned int w, unsigned int h, BOOL alpha) ++{ ++ unsigned int x, y; ++ DWORD color; ++ ++ TRACE("Converting %ux%u pixels, pitches %u %u\n", w, h, pitch_in, pitch_out); ++ ++ for (y = 0; y < h; ++y) ++ { ++ DWORD *dst_line = (DWORD *)(dst + y * pitch_out); ++ for (x = 0; x < w; ++x) ++ { ++ dxt1_get_pixel(src, pitch_in, x, y, &color); ++ if (alpha) ++ dst_line[x] = (color & 0xFF00FF00) | ((color & 0xFF) << 16) | ((color & 0xFF0000) >> 16); ++ else ++ { ++ dst_line[x] = 0xFF000000 | ((color & 0xFF) << 16) | ++ (color & 0xFF00) | ((color & 0xFF0000) >> 16); ++ } ++ } ++ } ++ ++ return TRUE; ++} ++ ++static inline BOOL x8r8g8b8_to_dxt1(const BYTE *src, BYTE *dst, ++ DWORD pitch_in, DWORD pitch_out, unsigned int w, unsigned int h, BOOL alpha) ++{ ++ unsigned int x, y; ++ DWORD color, *tmp; ++ ++ TRACE("Converting %ux%u pixels, pitches %u %u\n", w, h, pitch_in, pitch_out); ++ ++ tmp = HeapAlloc(GetProcessHeap(), 0, h * w * sizeof(DWORD)); ++ if (!tmp) ++ { ++ ERR("Failed to allocate memory for conversion\n"); ++ return FALSE; ++ } ++ ++ for (y = 0; y < h; ++y) ++ { ++ const DWORD *src_line = (const DWORD *)(src + y * pitch_in); ++ DWORD *dst_line = tmp + y * w; ++ for (x = 0; x < w; ++x) ++ { ++ color = src_line[x]; ++ if (alpha) ++ dst_line[x] = (color & 0xFF00FF00) | ((color & 0xFF) << 16) | ((color & 0xFF0000) >> 16); ++ else ++ { ++ dst_line[x] = 0xFF000000 | ((color & 0xFF) << 16) | ++ (color & 0xFF00) | ((color & 0xFF0000) >> 16); ++ } ++ } ++ } ++ ++ ptx_compress_dxtn(4, w, h, (BYTE *)tmp, alpha ? GL_COMPRESSED_RGBA_S3TC_DXT1_EXT : ++ GL_COMPRESSED_RGB_S3TC_DXT1_EXT, dst, pitch_out); ++ ++ HeapFree(GetProcessHeap(), 0, tmp); ++ return TRUE; ++} ++ ++static inline BOOL x1r5g5b5_to_dxt1(const BYTE *src, BYTE *dst, ++ DWORD pitch_in, DWORD pitch_out, unsigned int w, unsigned int h, BOOL alpha) ++{ ++ static const unsigned char convert_5to8[] = ++ { ++ 0x00, 0x08, 0x10, 0x19, 0x21, 0x29, 0x31, 0x3a, ++ 0x42, 0x4a, 0x52, 0x5a, 0x63, 0x6b, 0x73, 0x7b, ++ 0x84, 0x8c, 0x94, 0x9c, 0xa5, 0xad, 0xb5, 0xbd, ++ 0xc5, 0xce, 0xd6, 0xde, 0xe6, 0xef, 0xf7, 0xff, ++ }; ++ unsigned int x, y; ++ DWORD *tmp; ++ WORD color; ++ ++ TRACE("Converting %ux%u pixels, pitches %u %u.\n", w, h, pitch_in, pitch_out); ++ ++ tmp = HeapAlloc(GetProcessHeap(), 0, h * w * sizeof(DWORD)); ++ if (!tmp) ++ { ++ ERR("Failed to allocate memory for conversion\n"); ++ return FALSE; ++ } ++ ++ for (y = 0; y < h; ++y) ++ { ++ const WORD *src_line = (const WORD *)(src + y * pitch_in); ++ DWORD *dst_line = tmp + y * w; ++ for (x = 0; x < w; ++x) ++ { ++ color = src_line[x]; ++ if (alpha) ++ { ++ dst_line[x] = ((color & 0x8000) ? 0xFF000000 : 0) | ++ convert_5to8[(color & 0x001f)] << 16 | ++ convert_5to8[(color & 0x03e0) >> 5] << 8 | ++ convert_5to8[(color & 0x7c00) >> 10]; ++ } ++ else ++ { ++ dst_line[x] = convert_5to8[(color & 0x001f)] << 16 | ++ convert_5to8[(color & 0x03e0) >> 5] << 8 | ++ convert_5to8[(color & 0x7c00) >> 10]; ++ } ++ } ++ } ++ ++ ptx_compress_dxtn(4, w, h, (BYTE *)tmp, alpha ? GL_COMPRESSED_RGBA_S3TC_DXT1_EXT : ++ GL_COMPRESSED_RGB_S3TC_DXT1_EXT, dst, pitch_out); ++ ++ HeapFree(GetProcessHeap(), 0, tmp); ++ return TRUE; ++} ++ ++BOOL wined3d_dxt1_decode(const BYTE *src, BYTE *dst, DWORD pitch_in, DWORD pitch_out, ++ enum wined3d_format_id format, unsigned int w, unsigned int h) ++{ ++ if (!ptx_compress_dxtn) ++ { ++ FIXME("Failed to decode DXT1 image, there is a problem with %s.\n", SONAME_LIBTXC_DXTN); ++ return FALSE; ++ } ++ ++ switch (format) ++ { ++ case WINED3DFMT_B8G8R8A8_UNORM: ++ return dxt1_to_x8r8g8b8(src, dst, pitch_in, pitch_out, w, h, TRUE); ++ case WINED3DFMT_B8G8R8X8_UNORM: ++ return dxt1_to_x8r8g8b8(src, dst, pitch_in, pitch_out, w, h, FALSE); ++ default: ++ break; ++ } ++ ++ FIXME("Cannot find a conversion function from format DXT1 to %s.\n", debug_d3dformat(format)); ++ return FALSE; ++} ++ ++BOOL wined3d_dxt1_encode(const BYTE *src, BYTE *dst, DWORD pitch_in, DWORD pitch_out, ++ enum wined3d_format_id format, unsigned int w, unsigned int h) ++{ ++ if (!pfetch_2d_texel_rgba_dxt1) ++ { ++ FIXME("Failed to encode DXT1 image, there is a problem with %s.\n", SONAME_LIBTXC_DXTN); ++ return FALSE; ++ } ++ ++ switch (format) ++ { ++ case WINED3DFMT_B8G8R8A8_UNORM: ++ return x8r8g8b8_to_dxt1(src, dst, pitch_in, pitch_out, w, h, TRUE); ++ case WINED3DFMT_B8G8R8X8_UNORM: ++ return x8r8g8b8_to_dxt1(src, dst, pitch_in, pitch_out, w, h, FALSE); ++ case WINED3DFMT_B5G5R5A1_UNORM: ++ return x1r5g5b5_to_dxt1(src, dst, pitch_in, pitch_out, w, h, TRUE); ++ case WINED3DFMT_B5G5R5X1_UNORM: ++ return x1r5g5b5_to_dxt1(src, dst, pitch_in, pitch_out, w, h, FALSE); ++ default: ++ break; ++ } ++ ++ FIXME("Cannot find a conversion function from format %s to DXT1.\n", debug_d3dformat(format)); ++ return FALSE; ++} ++ ++BOOL wined3d_dxtn_init(void) ++{ ++ txc_dxtn_handle = wine_dlopen(SONAME_LIBTXC_DXTN, RTLD_NOW, NULL, 0); ++ if (!txc_dxtn_handle) ++ { ++ FIXME("Wine cannot find the library %s, DXTn software support unavailable.\n", SONAME_LIBTXC_DXTN); ++ return FALSE; ++ } ++ ++ #define LOAD_FUNCPTR(f) if((p##f = wine_dlsym(txc_dxtn_handle, #f, NULL, 0)) == NULL){WARN("Can't find symbol %s\n", #f);} ++ LOAD_FUNCPTR(fetch_2d_texel_rgba_dxt1); ++ LOAD_FUNCPTR(tx_compress_dxtn); ++ #undef LOAD_FUNCPTR ++ ++ return TRUE; ++} ++ ++void wined3d_dxtn_free(void) ++{ ++ if (txc_dxtn_handle) ++ wine_dlclose(txc_dxtn_handle, NULL, 0); ++} ++ ++#else ++ ++BOOL wined3d_dxt1_decode(const BYTE *src, BYTE *dst, DWORD pitch_in, DWORD pitch_out, ++ enum wined3d_format_id format, unsigned int w, unsigned int h) ++{ ++ FIXME("Failed to convert DXT1 texture. Wine is compiled without DXT1 support.\n"); ++ return FALSE; ++} ++ ++ ++BOOL wined3d_dxt1_encode(const BYTE *src, BYTE *dst, DWORD pitch_in, DWORD pitch_out, ++ enum wined3d_format_id format, unsigned int w, unsigned int h) ++{ ++ FIXME("Failed to convert DXT1 texture. Wine is compiled without DXT1 support.\n"); ++ return FALSE; ++} ++ ++BOOL wined3d_dxtn_init(void) ++{ ++ return FALSE; ++} ++ ++void wined3d_dxtn_free(void) ++{ ++ /* nothing to do */ ++} ++ ++#endif +\ No newline at end of file +diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c +index 04ef3f0..d8f1d3e 100644 +--- a/dlls/wined3d/surface.c ++++ b/dlls/wined3d/surface.c +@@ -2647,6 +2647,42 @@ static void convert_yuy2_r5g6b5(const BYTE *src, BYTE *dst, + } + } + ++static void convert_dxt1_a8r8g8b8(const BYTE *src, BYTE *dst, ++ DWORD pitch_in, DWORD pitch_out, unsigned int w, unsigned int h) ++{ ++ wined3d_dxt1_decode(src, dst, pitch_in, pitch_out, WINED3DFMT_B8G8R8A8_UNORM, w, h); ++} ++ ++static void convert_dxt1_x8r8g8b8(const BYTE *src, BYTE *dst, ++ DWORD pitch_in, DWORD pitch_out, unsigned int w, unsigned int h) ++{ ++ wined3d_dxt1_decode(src, dst, pitch_in, pitch_out, WINED3DFMT_B8G8R8X8_UNORM, w, h); ++} ++ ++static void convert_a8r8g8b8_dxt1(const BYTE *src, BYTE *dst, ++ DWORD pitch_in, DWORD pitch_out, unsigned int w, unsigned int h) ++{ ++ wined3d_dxt1_encode(src, dst, pitch_in, pitch_out, WINED3DFMT_B8G8R8A8_UNORM, w, h); ++} ++ ++static void convert_x8r8g8b8_dxt1(const BYTE *src, BYTE *dst, ++ DWORD pitch_in, DWORD pitch_out, unsigned int w, unsigned int h) ++{ ++ wined3d_dxt1_encode(src, dst, pitch_in, pitch_out, WINED3DFMT_B8G8R8X8_UNORM, w, h); ++} ++ ++static void convert_a1r5g5b5_dxt1(const BYTE *src, BYTE *dst, ++ DWORD pitch_in, DWORD pitch_out, unsigned int w, unsigned int h) ++{ ++ wined3d_dxt1_encode(src, dst, pitch_in, pitch_out, WINED3DFMT_B5G5R5A1_UNORM, w, h); ++} ++ ++static void convert_x1r5g5b5_dxt1(const BYTE *src, BYTE *dst, ++ DWORD pitch_in, DWORD pitch_out, unsigned int w, unsigned int h) ++{ ++ wined3d_dxt1_encode(src, dst, pitch_in, pitch_out, WINED3DFMT_B5G5R5X1_UNORM, w, h); ++} ++ + struct d3dfmt_converter_desc + { + enum wined3d_format_id from, to; +@@ -2661,6 +2697,12 @@ static const struct d3dfmt_converter_desc converters[] = + {WINED3DFMT_B8G8R8X8_UNORM, WINED3DFMT_B8G8R8A8_UNORM, convert_a8r8g8b8_x8r8g8b8}, + {WINED3DFMT_YUY2, WINED3DFMT_B8G8R8X8_UNORM, convert_yuy2_x8r8g8b8}, + {WINED3DFMT_YUY2, WINED3DFMT_B5G6R5_UNORM, convert_yuy2_r5g6b5}, ++ {WINED3DFMT_DXT1, WINED3DFMT_B8G8R8A8_UNORM, convert_dxt1_a8r8g8b8}, ++ {WINED3DFMT_DXT1, WINED3DFMT_B8G8R8X8_UNORM, convert_dxt1_x8r8g8b8}, ++ {WINED3DFMT_B8G8R8A8_UNORM, WINED3DFMT_DXT1, convert_a8r8g8b8_dxt1}, ++ {WINED3DFMT_B8G8R8X8_UNORM, WINED3DFMT_DXT1, convert_x8r8g8b8_dxt1}, ++ {WINED3DFMT_B5G5R5A1_UNORM, WINED3DFMT_DXT1, convert_a1r5g5b5_dxt1}, ++ {WINED3DFMT_B5G5R5X1_UNORM, WINED3DFMT_DXT1, convert_x1r5g5b5_dxt1} + }; + + static inline const struct d3dfmt_converter_desc *find_converter(enum wined3d_format_id from, +diff --git a/dlls/wined3d/wined3d_main.c b/dlls/wined3d/wined3d_main.c +index 758ba43..08021a2 100644 +--- a/dlls/wined3d/wined3d_main.c ++++ b/dlls/wined3d/wined3d_main.c +@@ -309,6 +309,8 @@ static BOOL wined3d_dll_init(HINSTANCE hInstDLL) + if (appkey) RegCloseKey( appkey ); + if (hkey) RegCloseKey( hkey ); + ++ wined3d_dxtn_init(); ++ + return TRUE; + } + +@@ -340,6 +342,9 @@ static BOOL wined3d_dll_destroy(HINSTANCE hInstDLL) + + DeleteCriticalSection(&wined3d_wndproc_cs); + DeleteCriticalSection(&wined3d_cs); ++ ++ wined3d_dxtn_free(); ++ + return TRUE; + } + +diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h +index f55b118..dceaa6d 100644 +--- a/dlls/wined3d/wined3d_private.h ++++ b/dlls/wined3d/wined3d_private.h +@@ -3105,6 +3105,11 @@ static inline void context_apply_state(struct wined3d_context *context, + state_table[rep].apply(context, state, rep); + } + ++BOOL wined3d_dxt1_decode(const BYTE *src, BYTE *dst, DWORD pitch_in, DWORD pitch_out, enum wined3d_format_id format, unsigned int w, unsigned int h); ++BOOL wined3d_dxt1_encode(const BYTE *src, BYTE *dst, DWORD pitch_in, DWORD pitch_out, enum wined3d_format_id format, unsigned int w, unsigned int h); ++BOOL wined3d_dxtn_init(void); ++void wined3d_dxtn_free(void); ++ + /* The WNDCLASS-Name for the fake window which we use to retrieve the GL capabilities */ + #define WINED3D_OPENGL_WINDOW_CLASS_NAME "WineD3D_OpenGL" + +-- +1.9.1 + diff --git a/patches/wined3d-DXTn/definition b/patches/wined3d-DXTn/definition new file mode 100644 index 00000000..0cdf949a --- /dev/null +++ b/patches/wined3d-DXTn/definition @@ -0,0 +1,4 @@ +Author: Michael Müller +Subject: Add support for DXTn software decoding through libxtc_dxtn. +Revision: 1 +Fixes: [25486] Lego Stunt Rally requires DXTn software de/encoding support diff --git a/patches/winepulse-PulseAudio_Support/0002-winepulse-Add-initial-stub-for-pulseaudio-support.patch b/patches/winepulse-PulseAudio_Support/0002-winepulse-Add-initial-stub-for-pulseaudio-support.patch index 772a7b42..50afc65b 100644 --- a/patches/winepulse-PulseAudio_Support/0002-winepulse-Add-initial-stub-for-pulseaudio-support.patch +++ b/patches/winepulse-PulseAudio_Support/0002-winepulse-Add-initial-stub-for-pulseaudio-support.patch @@ -18,14 +18,12 @@ diff --git a/configure.ac b/configure.ac index 7de7a87..84ec52f 100644 --- a/configure.ac +++ b/configure.ac -@@ -72,6 +72,7 @@ AC_ARG_WITH(pcap, AS_HELP_STRING([--without-pcap],[do not use the Packet Ca - AC_ARG_WITH(png, AS_HELP_STRING([--without-png],[do not use PNG])) +@@ -73,4 +73,5 @@ AC_ARG_WITH(png, AS_HELP_STRING([--without-png],[do not use PNG])) AC_ARG_WITH(pthread, AS_HELP_STRING([--without-pthread],[do not use the pthread library]), [if test "x$withval" = "xno"; then ac_cv_header_pthread_h=no; fi]) +AC_ARG_WITH(pulse, AC_HELP_STRING([--without-pulse],[do not use PulseAudio sound support])) AC_ARG_WITH(sane, AS_HELP_STRING([--without-sane],[do not use SANE (scanner support)])) AC_ARG_WITH(tiff, AS_HELP_STRING([--without-tiff],[do not use TIFF])) - AC_ARG_WITH(v4l, AS_HELP_STRING([--without-v4l],[do not use v4l1 (v4l support)])) @@ -1537,6 +1538,30 @@ then [GetText ${notice_platform}development files not found (or too old), po files can't be rebuilt.]) fi