Rebase against 94d61d1b280d0ef15474c0cf44f534d5d44eba1f.

This commit is contained in:
Alistair Leslie-Hughes 2023-07-14 11:08:23 +10:00
parent a88d536fba
commit b285e35fca
3 changed files with 20 additions and 20 deletions

View File

@ -19,7 +19,7 @@ index 8d608656143..cc8adccf049 100644
+{
+ DDCAPS *caps = ctx;
+
+ switch (format->u1.dwZBufferBitDepth)
+ switch (format->dwZBufferBitDepth)
+ {
+ case 8:
+ caps->dwZBufferBitDepths |= DDBD_8;

View File

@ -1,4 +1,4 @@
From e2505b43f26d0517aad97c2778958886568ad58b Mon Sep 17 00:00:00 2001
From ee590f3816dd8a60014214cdbd9c34c4489a842b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Sat, 30 May 2015 02:55:03 +0200
Subject: [PATCH] ddraw: Allow size and format conversions in
@ -9,10 +9,10 @@ Subject: [PATCH] ddraw: Allow size and format conversions in
1 file changed, 82 insertions(+), 71 deletions(-)
diff --git a/dlls/ddraw/surface.c b/dlls/ddraw/surface.c
index 421ce68fa1c..b2c674eba7a 100644
index 33f38949c15..099f3e92d98 100644
--- a/dlls/ddraw/surface.c
+++ b/dlls/ddraw/surface.c
@@ -5321,6 +5321,46 @@ static struct ddraw_surface *get_sub_mimaplevel(struct ddraw_surface *surface)
@@ -5473,6 +5473,46 @@ static struct ddraw_surface *get_sub_mimaplevel(struct ddraw_surface *surface)
return impl_from_IDirectDrawSurface7(next_level);
}
@ -27,22 +27,22 @@ index 421ce68fa1c..b2c674eba7a 100644
+ if (!(format1->dwFlags & DDPF_ALPHA))
+ {
+ /* The RGB and YUV bits are stored in the same fields */
+ if (format1->u1.dwRGBBitCount != format2->u1.dwRGBBitCount)
+ if (format1->dwRGBBitCount != format2->dwRGBBitCount)
+ return FALSE;
+
+ if (format1->u2.dwRBitMask != format2->u2.dwRBitMask)
+ if (format1->dwRBitMask != format2->dwRBitMask)
+ return FALSE;
+
+ if (format1->u3.dwGBitMask != format2->u3.dwGBitMask)
+ if (format1->dwGBitMask != format2->dwGBitMask)
+ return FALSE;
+
+ if (format1->u4.dwBBitMask != format2->u4.dwBBitMask)
+ if (format1->dwBBitMask != format2->dwBBitMask)
+ return FALSE;
+ }
+
+ if (format1->dwFlags & (DDPF_ALPHAPIXELS | DDPF_ALPHA))
+ {
+ if (format1->u5.dwRGBAlphaBitMask != format2->u5.dwRGBAlphaBitMask)
+ if (format1->dwRGBAlphaBitMask != format2->dwRGBAlphaBitMask)
+ return FALSE;
+ }
+ }
@ -59,7 +59,7 @@ index 421ce68fa1c..b2c674eba7a 100644
/*****************************************************************************
* IDirect3DTexture2::Load
*
@@ -5342,7 +5382,7 @@ static HRESULT WINAPI d3d_texture2_Load(IDirect3DTexture2 *iface, IDirect3DTextu
@@ -5494,7 +5534,7 @@ static HRESULT WINAPI d3d_texture2_Load(IDirect3DTexture2 *iface, IDirect3DTextu
{
struct ddraw_surface *dst_surface = impl_from_IDirect3DTexture2(iface);
struct ddraw_surface *src_surface = unsafe_impl_from_IDirect3DTexture2(src_texture);
@ -68,7 +68,7 @@ index 421ce68fa1c..b2c674eba7a 100644
HRESULT hr;
TRACE("iface %p, src_texture %p.\n", iface, src_texture);
@@ -5355,90 +5395,62 @@ static HRESULT WINAPI d3d_texture2_Load(IDirect3DTexture2 *iface, IDirect3DTextu
@@ -5507,90 +5547,62 @@ static HRESULT WINAPI d3d_texture2_Load(IDirect3DTexture2 *iface, IDirect3DTextu
wined3d_mutex_lock();
@ -77,7 +77,7 @@ index 421ce68fa1c..b2c674eba7a 100644
-
- if (((src_surface->surface_desc.ddsCaps.dwCaps & DDSCAPS_MIPMAP)
- != (dst_surface->surface_desc.ddsCaps.dwCaps & DDSCAPS_MIPMAP))
- || (src_surface->surface_desc.u2.dwMipMapCount != dst_surface->surface_desc.u2.dwMipMapCount))
- || (src_surface->surface_desc.dwMipMapCount != dst_surface->surface_desc.dwMipMapCount))
- {
- ERR("Trying to load surfaces with different mip-map counts.\n");
- }
@ -98,8 +98,8 @@ index 421ce68fa1c..b2c674eba7a 100644
- src_pal = src_surface->palette;
-
- if (src_pal)
+ if (compare_format(&src_surface->surface_desc.u4.ddpfPixelFormat,
+ &dst_surface->surface_desc.u4.ddpfPixelFormat))
+ if (compare_format(&src_surface->surface_desc.ddpfPixelFormat,
+ &dst_surface->surface_desc.ddpfPixelFormat))
{
- PALETTEENTRY palent[256];
+ struct ddraw_palette *dst_pal, *src_pal;
@ -125,7 +125,7 @@ index 421ce68fa1c..b2c674eba7a 100644
- if ((src_desc->dwWidth != dst_desc->dwWidth) || (src_desc->dwHeight != dst_desc->dwHeight))
- {
- /* Should also check for same pixel format, u1.lPitch, ... */
- /* Should also check for same pixel format, lPitch, ... */
- ERR("Error in surface sizes.\n");
- wined3d_mutex_unlock();
- return D3DERR_TEXTURE_LOAD_FAILED;
@ -175,8 +175,8 @@ index 421ce68fa1c..b2c674eba7a 100644
+ /* Suppress the ALLOCONLOAD flag */
+ dst_surface->surface_desc.ddsCaps.dwCaps &= ~DDSCAPS_ALLOCONLOAD;
- if (dst_surface->surface_desc.u4.ddpfPixelFormat.dwFlags & DDPF_FOURCC)
- memcpy(dst_map_desc.data, src_map_desc.data, src_surface->surface_desc.u1.dwLinearSize);
- if (dst_surface->surface_desc.ddpfPixelFormat.dwFlags & DDPF_FOURCC)
- memcpy(dst_map_desc.data, src_map_desc.data, src_surface->surface_desc.dwLinearSize);
- else
- memcpy(dst_map_desc.data, src_map_desc.data, src_map_desc.row_pitch * src_desc->dwHeight);
+ SetRect(&src_rect, 0, 0, src_surface->surface_desc.dwWidth, src_surface->surface_desc.dwHeight);
@ -197,7 +197,7 @@ index 421ce68fa1c..b2c674eba7a 100644
}
if (src_surface->surface_desc.ddsCaps.dwCaps & DDSCAPS_MIPMAP)
@@ -5451,12 +5463,11 @@ static HRESULT WINAPI d3d_texture2_Load(IDirect3DTexture2 *iface, IDirect3DTextu
@@ -5603,12 +5615,11 @@ static HRESULT WINAPI d3d_texture2_Load(IDirect3DTexture2 *iface, IDirect3DTextu
else
dst_surface = NULL;
@ -214,5 +214,5 @@ index 421ce68fa1c..b2c674eba7a 100644
wined3d_mutex_unlock();
--
2.34.1
2.40.1

View File

@ -1 +1 @@
fb4d36c66131d1c45ebdcb5d56151e8f7782ebd1
94d61d1b280d0ef15474c0cf44f534d5d44eba1f