You've already forked wine-staging
mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2025-04-13 14:42:51 -07:00
Compare commits
146 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
aa0c8391eb | ||
|
36020b4a0e | ||
|
4fa7fcd631 | ||
|
ebf36e4717 | ||
|
835c92a298 | ||
|
708eb528c0 | ||
|
77a24c72b8 | ||
|
8924ee42d8 | ||
|
e1b2c45272 | ||
|
9b43d37fd1 | ||
|
5b64f435e9 | ||
|
441fd5f422 | ||
|
c103bbb0b6 | ||
|
d88d44f1d9 | ||
|
5e84688c5f | ||
|
c110178b0d | ||
|
796c6b3a44 | ||
|
2ae11f25b0 | ||
|
30f69aa45a | ||
|
bb826f2185 | ||
|
c5767aad30 | ||
|
fa0cd8ead0 | ||
|
f247cd5d6b | ||
|
b17a3d6c54 | ||
|
c0e113dd3a | ||
|
946648d13f | ||
|
d9670d89d1 | ||
|
4914f150c5 | ||
|
0af25de63c | ||
|
0682c26496 | ||
|
db49cb3767 | ||
|
6f8931b39a | ||
|
0e1220c76d | ||
|
acb3c0bb3c | ||
|
a381f356d6 | ||
|
b69d02ba02 | ||
|
3546551685 | ||
|
2439dab96c | ||
|
f5190ef988 | ||
|
ec5fbb99b7 | ||
|
857466ad4c | ||
|
4378292a65 | ||
|
c2e4c17811 | ||
|
34a7d5e858 | ||
|
a4e8224bd8 | ||
|
1b224000ac | ||
|
2b9cd3663b | ||
|
4901d72e77 | ||
|
735225dbaa | ||
|
7042b486e2 | ||
|
4ef147fbe5 | ||
|
7b9777c23e | ||
|
aed0bcfb83 | ||
|
22f5ea5e4f | ||
|
7f5729fc14 | ||
|
7fda13a16d | ||
|
667ee8a4ff | ||
|
b45a0aead3 | ||
|
36483a9c11 | ||
|
28834e80f8 | ||
|
49770c6bc6 | ||
|
93f5b4f6a0 | ||
|
e452a6cbdc | ||
|
23ccc2eef1 | ||
|
18f976c338 | ||
|
05bc4b822f | ||
|
177488c071 | ||
|
d0d5fef5bb | ||
|
7d45af5cb4 | ||
|
ad6dc1328b | ||
|
f6f66d11a2 | ||
|
5ab7824f62 | ||
|
c263c6fabb | ||
|
f10d2d0452 | ||
|
bc8dead787 | ||
|
3738f9baee | ||
|
c2de76b804 | ||
|
5a9719f283 | ||
|
c8d46d4ca3 | ||
|
4f96088b1e | ||
|
7f8391d22f | ||
|
2f87552459 | ||
|
4f83c2f614 | ||
|
dc277fed5e | ||
|
342b3b8162 | ||
|
891daebf57 | ||
|
7ba8823e57 | ||
|
5a368dddd1 | ||
|
4cd3d8eba4 | ||
|
e0593972f0 | ||
|
e7a74d707b | ||
|
8b3f47c1d2 | ||
|
78f630993b | ||
|
3f86dff407 | ||
|
65b72cb912 | ||
|
32abf9fc97 | ||
|
f03d32e381 | ||
|
da7652e29c | ||
|
1bc2bc0404 | ||
|
e2b1620f07 | ||
|
e3d0d19955 | ||
|
d4483ee98c | ||
|
0236a37992 | ||
|
0e08b05863 | ||
|
6ae3756a4f | ||
|
8ad449f7b1 | ||
|
0855d4defe | ||
|
78bd3f0c6d | ||
|
16cfc61df8 | ||
|
153172ad27 | ||
|
5a1b9d5093 | ||
|
c1f62cba4d | ||
|
02792d0328 | ||
|
44f9ec9761 | ||
|
81492f7156 | ||
|
683813d151 | ||
|
858bf979a1 | ||
|
c2319432af | ||
|
ff1bc55757 | ||
|
3695e09653 | ||
|
ef36ee4399 | ||
|
3dfacea342 | ||
|
1212b7ddff | ||
|
16dce52124 | ||
|
8a4e32eb32 | ||
|
1baaa8fbfc | ||
|
f09458658e | ||
|
e68e4dbb75 | ||
|
2e768aee87 | ||
|
b6944be810 | ||
|
ce31cba943 | ||
|
52f5128abc | ||
|
d7706d345c | ||
|
27b121f293 | ||
|
ab9df8f932 | ||
|
4127a50f6b | ||
|
deb7042324 | ||
|
21a71e43b2 | ||
|
fdd5079133 | ||
|
acfbb64262 | ||
|
041773cac4 | ||
|
f43640039b | ||
|
8999a04fd6 | ||
|
3c0ae5d07c | ||
|
294e058f4b | ||
|
edbcee8c11 |
8
.github/workflows/macOS.yml
vendored
8
.github/workflows/macOS.yml
vendored
@@ -20,7 +20,6 @@ jobs:
|
||||
bison \
|
||||
gphoto2 \
|
||||
gstreamer \
|
||||
gcenx/wine/libinotify-kqueue \
|
||||
mingw-w64 \
|
||||
molten-vk \
|
||||
sdl2
|
||||
@@ -44,10 +43,11 @@ jobs:
|
||||
cd wine
|
||||
$GITHUB_WORKSPACE/staging/patchinstall.py DESTDIR=. --all
|
||||
|
||||
- name: Configure wine64
|
||||
- name: Configure wine
|
||||
env:
|
||||
LDFLAGS: "-Wl,-rpath,/opt/X11/lib"
|
||||
# Avoid weird linker errors with Xcode 10 and later
|
||||
# We need to tell the linker to add brew & Xquarts to the rpath stack.
|
||||
LDFLAGS: "-Wl,-rpath,/usr/local/lib -Wl,-rpath,/opt/X11/lib"
|
||||
# Use an older deployment target to avoid new dyld behaviors.
|
||||
MACOSX_DEPLOYMENT_TARGET: "10.14"
|
||||
run: |
|
||||
cd $GITHUB_WORKSPACE/wine
|
||||
|
@@ -1,15 +1,15 @@
|
||||
From 6a4be6a3089d37ff825853d2644d826d80d59e4f Mon Sep 17 00:00:00 2001
|
||||
From 3dc4a148d7c91afea8f589f47daca82c5c27b7c1 Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Lackner <sebastian@fds-team.de>
|
||||
Date: Thu, 2 Oct 2014 19:44:31 +0200
|
||||
Subject: [PATCH] ntdll: Print a warning message specifying the wine-staging
|
||||
branch name and version.
|
||||
|
||||
---
|
||||
dlls/ntdll/loader.c | 15 +++++++++++++++
|
||||
1 file changed, 15 insertions(+)
|
||||
dlls/ntdll/loader.c | 19 +++++++++++++++++++
|
||||
1 file changed, 19 insertions(+)
|
||||
|
||||
diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c
|
||||
index bad1492e138..6f80e7b3a28 100644
|
||||
index 74eb1b7f500..95639558155 100644
|
||||
--- a/dlls/ntdll/loader.c
|
||||
+++ b/dlls/ntdll/loader.c
|
||||
@@ -43,6 +43,7 @@ WINE_DECLARE_DEBUG_CHANNEL(relay);
|
||||
@@ -20,7 +20,7 @@ index bad1492e138..6f80e7b3a28 100644
|
||||
|
||||
#ifdef _WIN64
|
||||
#define DEFAULT_SECURITY_COOKIE_64 (((ULONGLONG)0x00002b99 << 32) | 0x2ddfa232)
|
||||
@@ -3823,6 +3824,7 @@ void WINAPI LdrShutdownProcess(void)
|
||||
@@ -3870,6 +3871,7 @@ void WINAPI LdrShutdownProcess(void)
|
||||
process_detach();
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ index bad1492e138..6f80e7b3a28 100644
|
||||
|
||||
/******************************************************************
|
||||
* RtlExitUserProcess (NTDLL.@)
|
||||
@@ -4317,6 +4319,9 @@ static void release_address_space(void)
|
||||
@@ -4366,6 +4368,9 @@ static void release_address_space(void)
|
||||
*/
|
||||
void loader_init( CONTEXT *context, void **entry )
|
||||
{
|
||||
@@ -38,10 +38,13 @@ index bad1492e138..6f80e7b3a28 100644
|
||||
static int attach_done;
|
||||
NTSTATUS status;
|
||||
ULONG_PTR cookie, port = 0;
|
||||
@@ -4397,6 +4402,16 @@ void loader_init( CONTEXT *context, void **entry )
|
||||
@@ -4455,6 +4460,20 @@ void loader_init( CONTEXT *context, void **entry )
|
||||
arm64ec_thread_init();
|
||||
#endif
|
||||
wm = get_modref( NtCurrentTeb()->Peb->ImageBaseAddress );
|
||||
}
|
||||
|
||||
+ /* This hunk occasionally applies in the wrong place;
|
||||
+ * add a comment here to try to prevent that. */
|
||||
+ }
|
||||
+ RtlInitUnicodeString( &staging_event_string, L"\\__wine_staging_warn_event" );
|
||||
+ InitializeObjectAttributes( &staging_event_attr, &staging_event_string, OBJ_OPENIF, NULL, NULL );
|
||||
+ if (NtCreateEvent( &staging_event, EVENT_ALL_ACCESS, &staging_event_attr, NotificationEvent, FALSE ) == STATUS_SUCCESS)
|
||||
@@ -50,11 +53,12 @@ index bad1492e138..6f80e7b3a28 100644
|
||||
+ FIXME_(winediag)("Please mention your exact version when filing bug reports on winehq.org.\n");
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ WARN_(winediag)("wine-staging %s is a testing version containing experimental patches.\n", wine_get_version());
|
||||
+
|
||||
RtlAcquirePebLock();
|
||||
InsertHeadList( &tls_links, &NtCurrentTeb()->TlsLinks );
|
||||
RtlReleasePebLock();
|
||||
+ NtClose( staging_event );
|
||||
}
|
||||
|
||||
NtCurrentTeb()->FlsSlots = fls_alloc_data();
|
||||
--
|
||||
2.43.0
|
||||
2.47.2
|
||||
|
||||
|
@@ -1,197 +0,0 @@
|
||||
From 0173ca4b3352506b76801619ae5a05f338d6ff6e Mon Sep 17 00:00:00 2001
|
||||
From: Jason Edmeades <us@edmeades.me.uk>
|
||||
Date: Tue, 16 Jul 2019 13:49:18 +1000
|
||||
Subject: [PATCH] cmd: Support for launching programs based on file association
|
||||
|
||||
cmd already handles exe, cmd, bat etc but if you run a file with another extension,
|
||||
then use the associations set in the registry (for example via ftype / assoc) to
|
||||
launch a program. This enables you to run test.txt and notepad to pop up, or
|
||||
fred.msi for msiexec to be launched.
|
||||
|
||||
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=18154
|
||||
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=36646
|
||||
---
|
||||
programs/cmd/wcmdmain.c | 139 +++++++++++++++++++++++++++++-----------
|
||||
1 file changed, 102 insertions(+), 37 deletions(-)
|
||||
|
||||
diff --git a/programs/cmd/wcmdmain.c b/programs/cmd/wcmdmain.c
|
||||
index ce48b16d7ec..2d20ee299fa 100644
|
||||
--- a/programs/cmd/wcmdmain.c
|
||||
+++ b/programs/cmd/wcmdmain.c
|
||||
@@ -1541,8 +1541,10 @@ void WCMD_run_program (WCHAR *command, BOOL called)
|
||||
|
||||
/* 1. If extension supplied, see if that file exists */
|
||||
if (extensionsupplied) {
|
||||
- if (GetFileAttributesW(thisDir) != INVALID_FILE_ATTRIBUTES) {
|
||||
+ DWORD attribs = GetFileAttributesW(thisDir);
|
||||
+ if (attribs != INVALID_FILE_ATTRIBUTES && !(attribs&FILE_ATTRIBUTE_DIRECTORY)) {
|
||||
found = TRUE;
|
||||
+ WINE_TRACE("Found as file with extension as '%s'\n", wine_dbgstr_w(thisDir));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1572,6 +1574,7 @@ void WCMD_run_program (WCHAR *command, BOOL called)
|
||||
}
|
||||
|
||||
if (GetFileAttributesW(thisDir) != INVALID_FILE_ATTRIBUTES) {
|
||||
+ WINE_TRACE("Found via search and pathext as '%s'\n", wine_dbgstr_w(thisDir));
|
||||
found = TRUE;
|
||||
thisExt = NULL;
|
||||
}
|
||||
@@ -1595,6 +1598,7 @@ void WCMD_run_program (WCHAR *command, BOOL called)
|
||||
RETURN_CODE return_code;
|
||||
BOOL oldinteractive = interactive;
|
||||
|
||||
+ WINE_TRACE("Calling batch program\n");
|
||||
interactive = FALSE;
|
||||
return_code = WCMD_batch(thisDir, command, NULL, INVALID_HANDLE_VALUE);
|
||||
interactive = oldinteractive;
|
||||
@@ -1605,48 +1609,109 @@ void WCMD_run_program (WCHAR *command, BOOL called)
|
||||
if (return_code != RETURN_CODE_ABORTED && return_code != RETURN_CODE_OLD_CHAINING)
|
||||
errorlevel = return_code;
|
||||
return;
|
||||
- } else {
|
||||
- DWORD exit_code;
|
||||
- /* thisDir contains the file to be launched, but with what?
|
||||
- eg. a.exe will require a.exe to be launched, a.html may be iexplore */
|
||||
- hinst = FindExecutableW (thisDir, NULL, temp);
|
||||
- if ((INT_PTR)hinst < 32)
|
||||
- console = 0;
|
||||
- else
|
||||
- console = SHGetFileInfoW(temp, 0, &psfi, sizeof(psfi), SHGFI_EXETYPE);
|
||||
-
|
||||
- ZeroMemory (&st, sizeof(STARTUPINFOW));
|
||||
- st.cb = sizeof(STARTUPINFOW);
|
||||
- init_msvcrt_io_block(&st);
|
||||
-
|
||||
- /* Launch the process and if a CUI wait on it to complete
|
||||
- Note: Launching internal wine processes cannot specify a full path to exe */
|
||||
- status = CreateProcessW(thisDir,
|
||||
- command, NULL, NULL, TRUE, 0, NULL, NULL, &st, &pe);
|
||||
- free(st.lpReserved2);
|
||||
- if ((opt_c || opt_k) && !opt_s && !status
|
||||
- && GetLastError()==ERROR_FILE_NOT_FOUND && command[0]=='\"') {
|
||||
- /* strip first and last quote WCHARacters and try again */
|
||||
- WCMD_strip_quotes(command);
|
||||
- opt_s = TRUE;
|
||||
- WCMD_run_program(command, called);
|
||||
+ }
|
||||
+
|
||||
+ /* Calculate what program will be launched, and whether it is a
|
||||
+ console application or not. Note the program may be different
|
||||
+ from the parameter (eg running a .txt file will launch notepad.exe) */
|
||||
+ hinst = FindExecutableW (thisDir, NULL, temp);
|
||||
+ if ((INT_PTR)hinst < 32)
|
||||
+ console = 0; /* Assume not console app by default */
|
||||
+ else
|
||||
+ console = SHGetFileInfoW(temp, 0, &psfi, sizeof(psfi), SHGFI_EXETYPE);
|
||||
+
|
||||
+
|
||||
+ /* If it is not a .com or .exe, try to launch through ShellExecuteExW
|
||||
+ which takes into account the association for the extension. */
|
||||
+ if (ext && (wcsicmp(ext, L".exe") && wcsicmp(ext, L".com"))) {
|
||||
+
|
||||
+ SHELLEXECUTEINFOW shexw;
|
||||
+ BOOL rc;
|
||||
+ WCHAR *rawarg;
|
||||
+
|
||||
+ WCMD_parameter(command, 1, &rawarg, FALSE, TRUE);
|
||||
+ WINE_TRACE("Launching via ShellExecuteEx\n");
|
||||
+ memset(&shexw, 0x00, sizeof(shexw));
|
||||
+ shexw.cbSize = sizeof(SHELLEXECUTEINFOW);
|
||||
+ shexw.fMask = SEE_MASK_NO_CONSOLE | /* Run in same console as currently using */
|
||||
+ SEE_MASK_NOCLOSEPROCESS; /* We need a process handle to possibly wait on */
|
||||
+ shexw.lpFile = thisDir;
|
||||
+ shexw.lpParameters = rawarg;
|
||||
+ shexw.nShow = SW_SHOWNORMAL;
|
||||
+
|
||||
+ /* Try to launch the binary or its associated program */
|
||||
+ rc = ShellExecuteExW(&shexw);
|
||||
+
|
||||
+ if (rc && (INT_PTR)shexw.hInstApp >= 32) {
|
||||
+
|
||||
+ WINE_TRACE("Successfully launched\n");
|
||||
+
|
||||
+ /* It worked... Always wait when non-interactive (cmd /c or in
|
||||
+ batch program), or for console applications */
|
||||
+ if (!interactive || (console && !HIWORD(console))) {
|
||||
+ WINE_TRACE("Waiting for process to end\n");
|
||||
+ WaitForSingleObject (shexw.hProcess, INFINITE);
|
||||
+ }
|
||||
+
|
||||
+ GetExitCodeProcess (shexw.hProcess, &errorlevel);
|
||||
+ if (errorlevel == STILL_ACTIVE) {
|
||||
+ WINE_TRACE("Process still running, but returning anyway\n");
|
||||
+ errorlevel = 0;
|
||||
+ } else {
|
||||
+ WINE_TRACE("Process ended, errorlevel %ld\n", errorlevel);
|
||||
+ }
|
||||
+
|
||||
+ CloseHandle(pe.hProcess);
|
||||
return;
|
||||
+
|
||||
}
|
||||
+ }
|
||||
|
||||
- if (!status)
|
||||
- break;
|
||||
+ /* If its a .exe or .com or the shellexecute failed due to no association,
|
||||
+ CreateProcess directly */
|
||||
+ ZeroMemory (&st, sizeof(STARTUPINFOW));
|
||||
+ st.cb = sizeof(STARTUPINFOW);
|
||||
+ init_msvcrt_io_block(&st);
|
||||
+
|
||||
+ /* Launch the process and if a CUI wait on it to complete
|
||||
+ Note: Launching internal wine processes cannot specify a full path to exe */
|
||||
+ WINE_TRACE("Launching via CreateProcess\n");
|
||||
+ status = CreateProcessW(thisDir,
|
||||
+ command, NULL, NULL, TRUE, 0, NULL, NULL, &st, &pe);
|
||||
+ free(st.lpReserved2);
|
||||
+ if ((opt_c || opt_k) && !opt_s && !status
|
||||
+ && GetLastError()==ERROR_FILE_NOT_FOUND && command[0]=='\"') {
|
||||
+ /* strip first and last quote WCHARacters and try again */
|
||||
+ WCMD_strip_quotes(command);
|
||||
+ opt_s = TRUE;
|
||||
+ WCMD_run_program(command, called);
|
||||
+ return;
|
||||
+ }
|
||||
|
||||
- /* Always wait when non-interactive (cmd /c or in batch program),
|
||||
- or for console applications */
|
||||
- if (!interactive || (console && !HIWORD(console)))
|
||||
- WaitForSingleObject (pe.hProcess, INFINITE);
|
||||
- GetExitCodeProcess (pe.hProcess, &exit_code);
|
||||
- errorlevel = (exit_code == STILL_ACTIVE) ? NO_ERROR : exit_code;
|
||||
+ if (!status) {
|
||||
+ WINE_TRACE("Failed to launch via CreateProcess, rc %d (%ld)\n",
|
||||
+ status, GetLastError());
|
||||
+ break;
|
||||
+ }
|
||||
|
||||
- CloseHandle(pe.hProcess);
|
||||
- CloseHandle(pe.hThread);
|
||||
- return;
|
||||
+ /* Always wait when non-interactive (cmd /c or in batch program),
|
||||
+ or for console applications */
|
||||
+ if (!interactive || (console && !HIWORD(console))) {
|
||||
+ WINE_TRACE("Waiting for process to end\n");
|
||||
+ WaitForSingleObject (pe.hProcess, INFINITE);
|
||||
}
|
||||
+
|
||||
+ GetExitCodeProcess (pe.hProcess, &errorlevel);
|
||||
+ if (errorlevel == STILL_ACTIVE) {
|
||||
+ WINE_TRACE("Process still running, but returning anyway\n");
|
||||
+ errorlevel = 0;
|
||||
+ } else {
|
||||
+ WINE_TRACE("Process ended, errorlevel %ld\n", errorlevel);
|
||||
+ }
|
||||
+
|
||||
+ CloseHandle(pe.hProcess);
|
||||
+ CloseHandle(pe.hThread);
|
||||
+ return;
|
||||
}
|
||||
}
|
||||
|
||||
--
|
||||
2.45.2
|
||||
|
@@ -1,79 +0,0 @@
|
||||
From 2f9fa2d492521d297eb87e4b6709d8349818b9c6 Mon Sep 17 00:00:00 2001
|
||||
From: Jason Edmeades <us@edmeades.me.uk>
|
||||
Date: Tue, 16 Jul 2019 13:51:58 +1000
|
||||
Subject: [PATCH] cmd: ftype failed to clear file associations
|
||||
|
||||
If a file association was set (e.g. ftype fred=xxx), ftype fred= needs to clear it,
|
||||
but previously it failed to do so.
|
||||
---
|
||||
programs/cmd/builtins.c | 6 +++---
|
||||
programs/cmd/tests/test_builtins.cmd | 9 +++++++++
|
||||
programs/cmd/tests/test_builtins.cmd.exp | 5 ++++-
|
||||
3 files changed, 16 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/programs/cmd/builtins.c b/programs/cmd/builtins.c
|
||||
index 1c39c35ca78..f23f9ef2046 100644
|
||||
--- a/programs/cmd/builtins.c
|
||||
+++ b/programs/cmd/builtins.c
|
||||
@@ -4101,11 +4101,11 @@ void WCMD_assoc (const WCHAR *args, BOOL assoc) {
|
||||
/* If nothing after '=' then clear value - only valid for ASSOC */
|
||||
if (*newValue == 0x00) {
|
||||
|
||||
- if (assoc) rc = RegDeleteKeyW(key, args);
|
||||
- if (assoc && rc == ERROR_SUCCESS) {
|
||||
+ rc = RegDeleteTreeW(key, args);
|
||||
+ if (rc == ERROR_SUCCESS) {
|
||||
WINE_TRACE("HKCR Key '%s' deleted\n", wine_dbgstr_w(args));
|
||||
|
||||
- } else if (assoc && rc != ERROR_FILE_NOT_FOUND) {
|
||||
+ } else if (rc != ERROR_FILE_NOT_FOUND) {
|
||||
WCMD_print_error();
|
||||
errorlevel = ERROR_FILE_NOT_FOUND;
|
||||
|
||||
diff --git a/programs/cmd/tests/test_builtins.cmd b/programs/cmd/tests/test_builtins.cmd
|
||||
index d5397560bc6..14666c85cac 100644
|
||||
--- a/programs/cmd/tests/test_builtins.cmd
|
||||
+++ b/programs/cmd/tests/test_builtins.cmd
|
||||
@@ -2670,6 +2670,12 @@ echo echo +++>> tmp.cmd
|
||||
echo ftype footype>> tmp.cmd
|
||||
cmd /c tmp.cmd
|
||||
|
||||
+echo --- testing association
|
||||
+ftype footype=cmd.exe /c "echo '%%1'"
|
||||
+echo dummy>test.foo
|
||||
+test.foo
|
||||
+del test.foo
|
||||
+
|
||||
echo --- resetting association
|
||||
assoc .foo=
|
||||
|
||||
@@ -2701,6 +2707,9 @@ echo .foo=footype
|
||||
echo footype=foo_opencmd
|
||||
echo +++
|
||||
echo footype=foo_opencmd
|
||||
+echo --- testing association
|
||||
+echo footype=cmd.exe /c "echo '%%1'"
|
||||
+echo Skipped as not enough permissions
|
||||
echo --- resetting association
|
||||
echo original value
|
||||
|
||||
diff --git a/programs/cmd/tests/test_builtins.cmd.exp b/programs/cmd/tests/test_builtins.cmd.exp
|
||||
index 0102c3bcbc5..a6d97bc8248 100644
|
||||
--- a/programs/cmd/tests/test_builtins.cmd.exp
|
||||
+++ b/programs/cmd/tests/test_builtins.cmd.exp
|
||||
@@ -1549,8 +1549,11 @@ footype=foo_opencmd
|
||||
footype=foo_opencmd
|
||||
+++
|
||||
footype=foo_opencmd
|
||||
+--- testing association
|
||||
+footype=cmd.exe /c "echo '%1'"
|
||||
+'@drive@@path@foobar\test.foo'@or_broken@Skipped as not enough permissions
|
||||
--- resetting association
|
||||
-@todo_wine@original value@or_broken@buggyXP@or_broken@!WINE_FOO!
|
||||
+original value@or_broken@buggyXP@or_broken@!WINE_FOO!
|
||||
------------ Testing CALL ------------
|
||||
--- external script
|
||||
foo@space@
|
||||
--
|
||||
2.43.0
|
||||
|
@@ -1,55 +0,0 @@
|
||||
From 5d1a7ff33160080ad2aca22f689c5b4b446837d8 Mon Sep 17 00:00:00 2001
|
||||
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
|
||||
Date: Tue, 18 Jun 2024 09:14:56 +1000
|
||||
Subject: [PATCH] cmd: Changed errorlevel type to DWORD
|
||||
|
||||
This stop the invalid type being passed to GetExitCodeProcess which is being reported
|
||||
as an error with clang/mingw in the latest version.
|
||||
---
|
||||
programs/cmd/builtins.c | 2 +-
|
||||
programs/cmd/wcmd.h | 2 +-
|
||||
programs/cmd/wcmdmain.c | 2 +-
|
||||
3 files changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/programs/cmd/builtins.c b/programs/cmd/builtins.c
|
||||
index 1e92e88d191..9b8cfd389b9 100644
|
||||
--- a/programs/cmd/builtins.c
|
||||
+++ b/programs/cmd/builtins.c
|
||||
@@ -442,7 +442,7 @@ RETURN_CODE WCMD_choice (const WCHAR * args)
|
||||
SetConsoleMode(GetStdHandle(STD_INPUT_HANDLE), oldmode);
|
||||
|
||||
errorlevel = (ptr - opt_c) + 1;
|
||||
- TRACE("answer: %d\n", errorlevel);
|
||||
+ TRACE("answer: %ld\n", errorlevel);
|
||||
free(my_command);
|
||||
return errorlevel;
|
||||
}
|
||||
diff --git a/programs/cmd/wcmd.h b/programs/cmd/wcmd.h
|
||||
index 6c76070338c..d750aca5572 100644
|
||||
--- a/programs/cmd/wcmd.h
|
||||
+++ b/programs/cmd/wcmd.h
|
||||
@@ -336,7 +336,7 @@ void WCMD_set_for_loop_variable(int var_idx, const WCHAR *value);
|
||||
* variables and batch parameters substitution already done.
|
||||
*/
|
||||
extern WCHAR quals[MAXSTRING], param1[MAXSTRING], param2[MAXSTRING];
|
||||
-extern int errorlevel;
|
||||
+extern DWORD errorlevel;
|
||||
extern BATCH_CONTEXT *context;
|
||||
extern FOR_CONTEXT *forloopcontext;
|
||||
extern BOOL delayedsubst;
|
||||
diff --git a/programs/cmd/wcmdmain.c b/programs/cmd/wcmdmain.c
|
||||
index 2df0d7c53d3..095be784f2c 100644
|
||||
--- a/programs/cmd/wcmdmain.c
|
||||
+++ b/programs/cmd/wcmdmain.c
|
||||
@@ -36,7 +36,7 @@ extern const WCHAR inbuilt[][10];
|
||||
extern struct env_stack *pushd_directories;
|
||||
|
||||
BATCH_CONTEXT *context = NULL;
|
||||
-int errorlevel;
|
||||
+DWORD errorlevel;
|
||||
WCHAR quals[MAXSTRING], param1[MAXSTRING], param2[MAXSTRING];
|
||||
BOOL interactive;
|
||||
FOR_CONTEXT *forloopcontext; /* The 'for' loop context */
|
||||
--
|
||||
2.43.0
|
||||
|
@@ -1,2 +0,0 @@
|
||||
Fixes: [18154] cmd: Support for launching programs based on file association
|
||||
Disabled: True
|
@@ -0,0 +1,267 @@
|
||||
From e4d55d451648b67c9269241efce8eee63faf70a4 Mon Sep 17 00:00:00 2001
|
||||
From: Philipp Knechtges <philipp-dev@knechtges.com>
|
||||
Date: Fri, 13 Sep 2024 11:16:44 +0200
|
||||
Subject: [PATCH] d2d1: Add tests for drawing ID2D1GeometryGroup
|
||||
|
||||
The functionality to draw ID2D1GeometryGroup is currently missing.
|
||||
Nothing is drawn. This causes the blank pages in the bug below.
|
||||
|
||||
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51139
|
||||
---
|
||||
dlls/d2d1/tests/d2d1.c | 219 +++++++++++++++++++++++++++++++++++++++++
|
||||
1 file changed, 219 insertions(+)
|
||||
|
||||
diff --git a/dlls/d2d1/tests/d2d1.c b/dlls/d2d1/tests/d2d1.c
|
||||
index 40bcf5079b8..41b36ef0dd5 100644
|
||||
--- a/dlls/d2d1/tests/d2d1.c
|
||||
+++ b/dlls/d2d1/tests/d2d1.c
|
||||
@@ -7061,6 +7061,7 @@ static void test_gradient(BOOL d3d11)
|
||||
static void test_draw_geometry(BOOL d3d11)
|
||||
{
|
||||
ID2D1TransformedGeometry *transformed_geometry[4];
|
||||
+ ID2D1GeometryGroup *geometry_group;
|
||||
ID2D1RectangleGeometry *rect_geometry[2];
|
||||
D2D1_POINT_2F point = {0.0f, 0.0f};
|
||||
D2D1_ROUNDED_RECT rounded_rect;
|
||||
@@ -7970,6 +7971,117 @@ static void test_draw_geometry(BOOL d3d11)
|
||||
hr = ID2D1PathGeometry_Open(geometry, &sink);
|
||||
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
|
||||
|
||||
+ set_point(&point, -0.402914f, 0.915514f);
|
||||
+ ID2D1GeometrySink_BeginFigure(sink, point, D2D1_FIGURE_BEGIN_HOLLOW);
|
||||
+ quadratic_to(sink, -0.310379f, 0.882571f, -0.116057f, 0.824000f);
|
||||
+ quadratic_to(sink, 0.008350f, 0.693614f, -0.052343f, 0.448886f);
|
||||
+ quadratic_to(sink, -0.154236f, 0.246072f, -0.279229f, 0.025343f);
|
||||
+ quadratic_to(sink, -0.370064f, -0.588586f, -0.383029f, -0.924114f);
|
||||
+ quadratic_to(sink, -0.295479f, -0.958764f, -0.017086f, -0.988400f);
|
||||
+ quadratic_to(sink, 0.208836f, -0.954157f, 0.272200f, -0.924114f);
|
||||
+ quadratic_to(sink, 0.295614f, -0.569071f, 0.230143f, 0.022886f);
|
||||
+ quadratic_to(sink, 0.101664f, 0.220643f, 0.012057f, 0.451571f);
|
||||
+ quadratic_to(sink, -0.028764f, 0.709014f, 0.104029f, 0.833943f);
|
||||
+ quadratic_to(sink, 0.319414f, 0.913057f, 0.403229f, 0.942628f);
|
||||
+ quadratic_to(sink, 0.317721f, 1.023450f, -0.017086f, 1.021771f);
|
||||
+ quadratic_to(sink, -0.310843f, 1.007472f, -0.402914f, 0.915514f);
|
||||
+ ID2D1GeometrySink_EndFigure(sink, D2D1_FIGURE_END_CLOSED);
|
||||
+
|
||||
+ hr = ID2D1GeometrySink_Close(sink);
|
||||
+ ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
|
||||
+ ID2D1GeometrySink_Release(sink);
|
||||
+
|
||||
+ set_matrix_identity(&matrix);
|
||||
+ translate_matrix(&matrix, 40.0f, 160.0f);
|
||||
+ scale_matrix(&matrix, 20.0f, 80.0f);
|
||||
+ hr = ID2D1Factory_CreateTransformedGeometry(factory,
|
||||
+ (ID2D1Geometry *)geometry, &matrix, &transformed_geometry[0]);
|
||||
+ ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
|
||||
+
|
||||
+ set_matrix_identity(&matrix);
|
||||
+ translate_matrix(&matrix, 160.0f, 640.0f);
|
||||
+ scale_matrix(&matrix, 40.0f, 160.0f);
|
||||
+ rotate_matrix(&matrix, M_PI / -5.0f);
|
||||
+ hr = ID2D1Factory_CreateTransformedGeometry(factory,
|
||||
+ (ID2D1Geometry *)geometry, &matrix, &transformed_geometry[1]);
|
||||
+ ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
|
||||
+ ID2D1PathGeometry_Release(geometry);
|
||||
+
|
||||
+ set_matrix_identity(&matrix);
|
||||
+ scale_matrix(&matrix, 0.5f, 1.0f);
|
||||
+ translate_matrix(&matrix, -80.0f, 0.0f);
|
||||
+ hr = ID2D1Factory_CreateTransformedGeometry(factory,
|
||||
+ (ID2D1Geometry *)transformed_geometry[1], &matrix, &transformed_geometry[2]);
|
||||
+ ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
|
||||
+
|
||||
+ set_matrix_identity(&matrix);
|
||||
+ rotate_matrix(&matrix, M_PI / 2.0f);
|
||||
+ translate_matrix(&matrix, 80.0f, -320.0f);
|
||||
+ scale_matrix(&matrix, 2.0f, 0.25f);
|
||||
+ hr = ID2D1Factory_CreateTransformedGeometry(factory,
|
||||
+ (ID2D1Geometry *)transformed_geometry[2], &matrix, &transformed_geometry[3]);
|
||||
+ ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
|
||||
+
|
||||
+ hr = ID2D1Factory_CreateGeometryGroup(factory, D2D1_FILL_MODE_WINDING,
|
||||
+ (ID2D1Geometry**) &transformed_geometry, 4, &geometry_group);
|
||||
+ ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
|
||||
+ ID2D1TransformedGeometry_Release(transformed_geometry[3]);
|
||||
+ ID2D1TransformedGeometry_Release(transformed_geometry[2]);
|
||||
+ ID2D1TransformedGeometry_Release(transformed_geometry[1]);
|
||||
+ ID2D1TransformedGeometry_Release(transformed_geometry[0]);
|
||||
+
|
||||
+ ID2D1RenderTarget_BeginDraw(rt);
|
||||
+ ID2D1RenderTarget_Clear(rt, &color);
|
||||
+ ID2D1RenderTarget_DrawGeometry(rt, (ID2D1Geometry *)geometry_group, (ID2D1Brush *)brush, 10.0f, NULL);
|
||||
+ hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
|
||||
+ ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
|
||||
+ ID2D1GeometryGroup_Release(geometry_group);
|
||||
+
|
||||
+ match = compare_figure(&ctx, 0, 0, 160, 160, 0xff652e89, 256,
|
||||
+ "iTANiwEagQEkeSp0LnIWAhZyFAYUchQGFHIUBhRyFAYUchQGFHIUBhRyFAYUchQGFHIUBhRyFAYU"
|
||||
+ "cxQFFHMUBRRzFAUUcxQFFHMUBRRzFAUUcxQFFHMUBRRzFAUUcxQFFHQUBBR0FAQUdBQDFHUUAxR1"
|
||||
+ "FAMUdRQDFHUUAxR1FQIUdhQCFHYUAhR2FAIUdhQCFHYUAhR2FAIUdhQBFHgoeCh4KHkmeiZ7JHwk"
|
||||
+ "fSJ+In8ggAEfggEeggEdhAEchQEbhQEahwEZhwEYiQEXiQEWigEWigEWigEWiwEViwEViwEViwEV"
|
||||
+ "igEXiQEXiQEXiQEYhwEZhgEbgwEefyR5KXQvbxgEGG4VBxhtMnAudCp6IoMBGOMu");
|
||||
+ ok(match, "Figure does not match.\n");
|
||||
+ match = compare_figure(&ctx, 160, 0, 320, 160, 0xff652e89, 512,
|
||||
+ "xpcBB7QCEqkCG6ACJJgCLI8CNYcCHgMc/gEeDBr4AR4UGPIBHR0W7AEdIxbmAR0pFt8BHTAV2gEd"
|
||||
+ "MBrWARwuIdMBGiwi1gEYKiPZARYoJNwBFiQk4AEWHyWxAQQvFhsltgEKKBYWJrwBECBOwQEXF0rI"
|
||||
+ "ARwOSM4Ba9UBYeABRf0BOIoCMZECLJYCKJoCJ5wCJp0CJJ8CIqICH6QCHagCGa4CFLoCB/yUAQAA");
|
||||
+ ok(match, "Figure does not match.\n");
|
||||
+ match = compare_figure(&ctx, 0, 160, 160, 320, 0xff652e89, 512,
|
||||
+ "yWQBnQEEmQEHlgELkwENkAEQjgETiwEVigEXhwEZhgEahQEcgwEdggEfgAEgfyF+I30jfCR8JXom"
|
||||
+ "eid4KHgodxQCFHYUAhR1FAMUdBUEFHMUBRRyFQUUchQHFHEUBxRwFAgUcBQJFG4UChRuFAoUbRUL"
|
||||
+ "FGwUDBRsFAwUbBQNFGwUDBRsFAwUbRQMFGwUDBRsFAwUbRQLFWwUDBRtFAsUbRQLFG0VCxRtFAsU"
|
||||
+ "bRQLFG4UCxRtFAsUbhQKFG4UCxRuFAoUbhQKFG4VCRRvFAoUbhQKFG8UCRRvFAoUbxQJFG8UCRRw"
|
||||
+ "FAgVbxQJFHAUCBRwFAgUcBUIFHAUCBRwFAgUcRQHFHEUBxRyFAYUchQGFHMUBRRzFAUUdBQEFHQU"
|
||||
+ "BBR1FAQUdBQEFHUUAxR1FAMUdhQCFHYUAhR2FQEUdxQBFHcpeCh4KHkneSd6JnoneiZ7JXwkfSN+"
|
||||
+ "In8hgAEggQEfgwEdhAEdhAEchQEbhgEahwEZiAEYGAFwGBYCcRcUBHEXEgZyFhEHchcOCXMWDAtz"
|
||||
+ "FgsMdBYIDnQWBhB1FgQQdhYCEnYqdyl3KXcpeCd5J3kneSd5JnomeyR8JHwkfCN9I30ifiF/IX4h"
|
||||
+ "fyF/IH8ggAEgfyCAASCAAR+AAR+BAR6CAR6BAR6CAR2CAR2DARyEARuEARuFARqGARmGARiKARSR"
|
||||
+ "AQqhYwAA");
|
||||
+ ok(match, "Figure does not match.\n");
|
||||
+ match = compare_figure(&ctx, 160, 160, 320, 320, 0xff652e89, 1024,
|
||||
+ "ytABA7gCCbICD60CFKkCF6cCGqMCHqACIZ0CJJoCJpgCKZUCFgIUkgIWBBWPAhYHFI4CFQoUjAIV"
|
||||
+ "DBSKAhUNFYgCFQ8UhwIVERSFAhUTFIMCFRQVgQIUFxSAAhQZFP4BFBoV/AEUHBT7ARQeFPkBFB8V"
|
||||
+ "9wEUIRT2ARQjFPQBFSMV8gEVJRTxARUnFPABFCgV7gEUKhTtARQsFOwBFCwV7AEULBTsARUsFOwB"
|
||||
+ "FSsV7AEULBTtARQsFO0BFCsU7QEVKxTtARUqFe0BFSoU7gEUKxTuARQqFe4BFCoU7wEUKhTuARUp"
|
||||
+ "FO8BFSkU7wEVKBXvARUoFPABFCkU8AEUKBTxARQoFPEBFCcV8QEUJxTxARUnFPEBFSYU8gEVJhTy"
|
||||
+ "ARUlFfIBFSUU8wEUJRXzARQlFPQBFCUU9AEUJBT1ARQkFPUBFCMU9gEUIhT2ARUhFPcBFSAU+AEV"
|
||||
+ "HxT5ARUeFPoBFR4U+gEVHRT7ARUcFPwBFRsU/QEVGhT+ARUZFP8BFBkUgAIUGBSBAhQXFIICFBcU"
|
||||
+ "ggIUFhSDAhQVFIQCFBQUhQIUExSGAhQSFIcCFBIUhwIUERSIAhUPFIkCFg0UigIXCxSNAhYJFI8C"
|
||||
+ "FggUkAIXBRSSAhcDFJQCFwEUlgIrlwIpmgImnAIkngIjnwIhoQIfowIepAIcpgIbpgIaqAIZqAIZ"
|
||||
+ "qAIYKwP7ARgnBf0BGCMI/QEZHgz+ARgbD/8BGBcSgAIYEhaAAhoNGIICGggcgwIaBB+DAjyEAjyF"
|
||||
+ "AjqGAjmIAjiIAiECFIkCFAIIBBSKAhQNFIsCFAwUjAIUCxSNAhQKFI4CFAkUjwIUBxWQAhQGFZEC"
|
||||
+ "FAUVkQIUBRWRAhQFFZECFQMVkwIUAxWTAhQDFZMCFAIVlAIVARWVAiqVAimWAimWAiiYAiaZAiaZ"
|
||||
+ "AiWaAiScAiKdAiGeAh+hAhyjAhmuAg3GxgEA");
|
||||
+ ok(match, "Figure does not match.\n");
|
||||
+
|
||||
+ hr = ID2D1Factory_CreatePathGeometry(factory, &geometry);
|
||||
+ ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
|
||||
+ hr = ID2D1PathGeometry_Open(geometry, &sink);
|
||||
+ ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
|
||||
+
|
||||
set_point(&point, 20.0f, 80.0f);
|
||||
ID2D1GeometrySink_BeginFigure(sink, point, D2D1_FIGURE_BEGIN_HOLLOW);
|
||||
quadratic_to(sink, 20.0f, 160.0f, 60.0f, 160.0f);
|
||||
@@ -8011,6 +8123,7 @@ static void test_draw_geometry(BOOL d3d11)
|
||||
static void test_fill_geometry(BOOL d3d11)
|
||||
{
|
||||
ID2D1TransformedGeometry *transformed_geometry[4];
|
||||
+ ID2D1GeometryGroup *geometry_group;
|
||||
ID2D1RectangleGeometry *rect_geometry[2];
|
||||
D2D1_POINT_2F point = {0.0f, 0.0f};
|
||||
D2D1_ROUNDED_RECT rounded_rect;
|
||||
@@ -8728,6 +8841,112 @@ static void test_fill_geometry(BOOL d3d11)
|
||||
hr = ID2D1PathGeometry_Open(geometry, &sink);
|
||||
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
|
||||
|
||||
+ set_point(&point, -0.402914f, 0.915514f);
|
||||
+ ID2D1GeometrySink_BeginFigure(sink, point, D2D1_FIGURE_BEGIN_FILLED);
|
||||
+ quadratic_to(sink, -0.310379f, 0.882571f, -0.116057f, 0.824000f);
|
||||
+ quadratic_to(sink, 0.008350f, 0.693614f, -0.052343f, 0.448886f);
|
||||
+ quadratic_to(sink, -0.154236f, 0.246072f, -0.279229f, 0.025343f);
|
||||
+ quadratic_to(sink, -0.370064f, -0.588586f, -0.383029f, -0.924114f);
|
||||
+ quadratic_to(sink, -0.295479f, -0.958764f, -0.017086f, -0.988400f);
|
||||
+ quadratic_to(sink, 0.208836f, -0.954157f, 0.272200f, -0.924114f);
|
||||
+ quadratic_to(sink, 0.295614f, -0.569071f, 0.230143f, 0.022886f);
|
||||
+ quadratic_to(sink, 0.101664f, 0.220643f, 0.012057f, 0.451571f);
|
||||
+ quadratic_to(sink, -0.028764f, 0.709014f, 0.104029f, 0.833943f);
|
||||
+ quadratic_to(sink, 0.319414f, 0.913057f, 0.403229f, 0.942628f);
|
||||
+ quadratic_to(sink, 0.317721f, 1.023450f, -0.017086f, 1.021771f);
|
||||
+ quadratic_to(sink, -0.310843f, 1.007472f, -0.402914f, 0.915514f);
|
||||
+ ID2D1GeometrySink_EndFigure(sink, D2D1_FIGURE_END_CLOSED);
|
||||
+
|
||||
+ hr = ID2D1GeometrySink_Close(sink);
|
||||
+ ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
|
||||
+ ID2D1GeometrySink_Release(sink);
|
||||
+
|
||||
+ set_matrix_identity(&matrix);
|
||||
+ translate_matrix(&matrix, 40.0f, 160.0f);
|
||||
+ scale_matrix(&matrix, 20.0f, 80.0f);
|
||||
+ hr = ID2D1Factory_CreateTransformedGeometry(factory,
|
||||
+ (ID2D1Geometry *)geometry, &matrix, &transformed_geometry[0]);
|
||||
+ ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
|
||||
+
|
||||
+ set_matrix_identity(&matrix);
|
||||
+ translate_matrix(&matrix, 160.0f, 640.0f);
|
||||
+ scale_matrix(&matrix, 40.0f, 160.0f);
|
||||
+ rotate_matrix(&matrix, M_PI / -5.0f);
|
||||
+ hr = ID2D1Factory_CreateTransformedGeometry(factory,
|
||||
+ (ID2D1Geometry *)geometry, &matrix, &transformed_geometry[1]);
|
||||
+ ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
|
||||
+ ID2D1PathGeometry_Release(geometry);
|
||||
+
|
||||
+ set_matrix_identity(&matrix);
|
||||
+ scale_matrix(&matrix, 0.5f, 1.0f);
|
||||
+ translate_matrix(&matrix, -80.0f, 0.0f);
|
||||
+ hr = ID2D1Factory_CreateTransformedGeometry(factory,
|
||||
+ (ID2D1Geometry *)transformed_geometry[1], &matrix, &transformed_geometry[2]);
|
||||
+ ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
|
||||
+
|
||||
+ set_matrix_identity(&matrix);
|
||||
+ rotate_matrix(&matrix, M_PI / 2.0f);
|
||||
+ translate_matrix(&matrix, 80.0f, -320.0f);
|
||||
+ scale_matrix(&matrix, 2.0f, 0.25f);
|
||||
+ hr = ID2D1Factory_CreateTransformedGeometry(factory,
|
||||
+ (ID2D1Geometry *)transformed_geometry[2], &matrix, &transformed_geometry[3]);
|
||||
+ ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
|
||||
+
|
||||
+ hr = ID2D1Factory_CreateGeometryGroup(factory, D2D1_FILL_MODE_WINDING,
|
||||
+ (ID2D1Geometry**) &transformed_geometry, 4, &geometry_group);
|
||||
+ ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
|
||||
+ ID2D1TransformedGeometry_Release(transformed_geometry[3]);
|
||||
+ ID2D1TransformedGeometry_Release(transformed_geometry[2]);
|
||||
+ ID2D1TransformedGeometry_Release(transformed_geometry[1]);
|
||||
+ ID2D1TransformedGeometry_Release(transformed_geometry[0]);
|
||||
+
|
||||
+ ID2D1RenderTarget_BeginDraw(rt);
|
||||
+ ID2D1RenderTarget_Clear(rt, &color);
|
||||
+ ID2D1RenderTarget_FillGeometry(rt, (ID2D1Geometry *)geometry_group, (ID2D1Brush *)brush, NULL);
|
||||
+ hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
|
||||
+ ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
|
||||
+ ID2D1GeometryGroup_Release(geometry_group);
|
||||
+
|
||||
+ match = compare_figure(&ctx, 0, 0, 160, 160, 0xff652e89, 32,
|
||||
+ "zzIBlwEOjQEXiAEahgEahgEahgEahgEahgEahgEahgEahgEahgEahgEahwEZhwEZhwEZhwEZhwEZ"
|
||||
+ "hwEZhwEZhwEZhwEZhwEZiAEYiAEYiAEXiQEXiQEXiQEXiQEXiQEXigEWigEWigEWigEWigEWigEW"
|
||||
+ "igEVjAEUjAEUjAEUjQESjgESjwEQkAEQkQEOkgENlAEMlAELlgEKlwEImAEImQEHmQEGmwEFmwEE"
|
||||
+ "nQEDnQECngECngECngECnwEBnwEBnwEBnwEBngEDnQEDnQEDnQEEmwEFmgEHmQEHlwELkQERjAEX"
|
||||
+ "hgEdhAEfgwEchwEWjwEMqTEA");
|
||||
+ ok(match, "Figure does not match.\n");
|
||||
+ match = compare_figure(&ctx, 160, 0, 320, 160, 0xff652e89, 32,
|
||||
+ "h58BBrUCD6wCGKQCIJsCKZMCMIwCNoUCPf8BQ/kBSPQBTu0BTu4BTfEBSfUBRfkBQf0BPYECOYUC"
|
||||
+ "NIoCMI4CK+UBAS0W/AEHIweQAgsZBpcCEAwIngIepAIZqQIWrAITsAIRswIOtQIMuAIJuwIHwAIB"
|
||||
+ "ypwB");
|
||||
+ ok(match, "Figure does not match.\n");
|
||||
+ match = compare_figure(&ctx, 0, 160, 160, 320, 0xff652e89, 32,
|
||||
+ "wW4DnAEEmwEFmgEHmAEIlwEKlQELlAEMkwEOkQEPkAEQkAERjgESjgESjQEUjAEUiwEWigEWiQEX"
|
||||
+ "iQEYhwEZhwEZhgEbhQEbhAEchAEdggEeggEeggEfgAEggAEggAEhgAEggAEggQEggAEggAEggQEf"
|
||||
+ "gQEggQEfgQEfggEfgQEfgQEfggEfgQEfggEeggEfggEeggEeggEegwEeggEegwEdgwEegwEdgwEd"
|
||||
+ "hAEchAEdhAEchAEchAEdhAEchAEchQEbhQEbhgEahgEahwEZhwEZiAEYiAEYiQEYiAEYiQEXiQEX"
|
||||
+ "igEWigEWiwEViwEVjAEUjAEUjAEUjQETjQETjgESjgETjgESjwERkAEQkgEOkwENlAEMlQELlgEK"
|
||||
+ "lwEJmAEJmAEImQEHmgEGmwEFnAEEnQEEnQEDnQEDngECngEDngECngECnwECngECnwECngECngED"
|
||||
+ "ngECEgGLAQMQAosBAw4EjAEDCwWNAQQJBo0BBQYIjQEHAgqNARKOARKPARCQARCQARCQAQ+RAQ6S"
|
||||
+ "AQ6SAQ2TAQ2SAQ2TAQ2TAQyTAQyUAQyTAQyUAQuVAQuUAQuVAQqWAQmWAQqWAQmXAQiXAQiYAQeY"
|
||||
+ "AQeZAQWbAQSDZwAA");
|
||||
+ ok(match, "Figure does not match.\n");
|
||||
+ match = compare_figure(&ctx, 160, 160, 320, 320, 0xff652e89, 32,
|
||||
+ "g90BBLkCCLYCC7ICDrACEa0CFKoCF6cCGqQCHKMCHqECIJ8CIpwCJJsCJpkCKJcCKZYCK5QCLZIC"
|
||||
+ "L5ACMI8CMo0CNIsCNYoCN4gCOYcCOYYCO4QCPYICPoECQIACQYACQIECQIACQIECQIECQIECP4IC"
|
||||
+ "P4ICP4ECP4ICP4ICPoMCPoMCPoMCPYQCPYMCPYQCPYQCPYQCPIUCPIUCPIUCO4YCO4YCOoYCO4YC"
|
||||
+ "OocCOocCOocCOYgCOYgCOIkCOIkCN4oCNosCNYwCNI0CM44CMo4CM44CMo8CMZACMJECL5ICLpMC"
|
||||
+ "LZQCLJUCK5YCK5YCKpcCKZgCKJkCJ5oCJpsCJpsCJZwCJJ4CIqACIKICH6MCHaUCG6cCGakCF6wC"
|
||||
+ "Fa0CE68CEbECD7MCDrQCDLYCCrgCCbkCB7sCBrsCBbwCBbwCBL0CBL0CBL0CBL0CA70CBL0CBL0C"
|
||||
+ "BLwCBSUBlgIFIQSXAgYbCJcCBxcKmQIIEQ6ZAgoMEJoCDQUTnAIknAIjnQIingIhnwIgoAIfoQIe"
|
||||
+ "ogIdowIcpAIbpQIapQIZpgIZpgIZpwIYpwIXqAIXqAIXqQIVqgIVqgIUqwITrQISrQIRrgIQsAIO"
|
||||
+ "sQIMswILtQIIhs4B");
|
||||
+ ok(match, "Figure does not match.\n");
|
||||
+
|
||||
+ hr = ID2D1Factory_CreatePathGeometry(factory, &geometry);
|
||||
+ ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
|
||||
+ hr = ID2D1PathGeometry_Open(geometry, &sink);
|
||||
+ ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
|
||||
+
|
||||
set_point(&point, -0.402914f, 0.915514f);
|
||||
ID2D1GeometrySink_BeginFigure(sink, point, D2D1_FIGURE_BEGIN_HOLLOW);
|
||||
quadratic_to(sink, -0.310379f, 0.882571f, -0.116057f, 0.824000f);
|
||||
--
|
||||
2.45.2
|
||||
|
@@ -0,0 +1,279 @@
|
||||
From be0fbef50483da8fe3fd0c4b74469d15a5c9f1ea Mon Sep 17 00:00:00 2001
|
||||
From: Philipp Knechtges <philipp-dev@knechtges.com>
|
||||
Date: Fri, 13 Sep 2024 16:37:31 +0200
|
||||
Subject: [PATCH] d2d1: Implement drawing for ID2D1GeometryGroup
|
||||
|
||||
Drawing of ID2D1GeometryGroup was so far unimplemented and resulted in
|
||||
blank drawing buffers. This partially fixes the rendering issues mentioned
|
||||
in the bug below.
|
||||
|
||||
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51139
|
||||
---
|
||||
dlls/d2d1/geometry.c | 236 ++++++++++++++++++++++++++++++++++++++++++-
|
||||
1 file changed, 235 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dlls/d2d1/geometry.c b/dlls/d2d1/geometry.c
|
||||
index 3da3ad2e65b..93925408077 100644
|
||||
--- a/dlls/d2d1/geometry.c
|
||||
+++ b/dlls/d2d1/geometry.c
|
||||
@@ -5497,8 +5497,13 @@ static const struct ID2D1GeometryGroupVtbl d2d_geometry_group_vtbl =
|
||||
HRESULT d2d_geometry_group_init(struct d2d_geometry *geometry, ID2D1Factory *factory,
|
||||
D2D1_FILL_MODE fill_mode, ID2D1Geometry **geometries, unsigned int geometry_count)
|
||||
{
|
||||
- unsigned int i;
|
||||
+ unsigned int i, j;
|
||||
+ struct d2d_geometry *other_geom;
|
||||
+ D2D_MATRIX_3X2_F g, gplain;
|
||||
+ size_t f_vertex_count, f_face_count, f_bezier_vertex_count, f_arc_vertex_count;
|
||||
+ size_t o_vertex_count, o_face_count, o_bezier_count, o_bezier_face_count, o_arc_count, o_arc_face_count;
|
||||
|
||||
+ FIXME("Ignoring fill_mode=%#x!\n", fill_mode);
|
||||
d2d_geometry_init(geometry, factory, &identity, (ID2D1GeometryVtbl *)&d2d_geometry_group_vtbl);
|
||||
|
||||
if (!(geometry->u.group.src_geometries = calloc(geometry_count, sizeof(*geometries))))
|
||||
@@ -5507,13 +5512,242 @@ HRESULT d2d_geometry_group_init(struct d2d_geometry *geometry, ID2D1Factory *fac
|
||||
return E_OUTOFMEMORY;
|
||||
}
|
||||
|
||||
+ geometry->fill.vertex_count = 0;
|
||||
+ geometry->fill.face_count = 0;
|
||||
+ geometry->fill.bezier_vertex_count = 0;
|
||||
+ geometry->fill.arc_vertex_count = 0;
|
||||
+ geometry->outline.vertex_count = 0;
|
||||
+ geometry->outline.face_count = 0;
|
||||
+ geometry->outline.bezier_count = 0;
|
||||
+ geometry->outline.bezier_face_count = 0;
|
||||
+ geometry->outline.arc_count = 0;
|
||||
+ geometry->outline.arc_face_count = 0;
|
||||
for (i = 0; i < geometry_count; ++i)
|
||||
{
|
||||
ID2D1Geometry_AddRef(geometry->u.group.src_geometries[i] = geometries[i]);
|
||||
+ other_geom = unsafe_impl_from_ID2D1Geometry(geometries[i]);
|
||||
+ geometry->fill.vertex_count += other_geom->fill.vertex_count;
|
||||
+ geometry->fill.face_count += other_geom->fill.face_count;
|
||||
+ geometry->fill.bezier_vertex_count += other_geom->fill.bezier_vertex_count;
|
||||
+ geometry->fill.arc_vertex_count += other_geom->fill.arc_vertex_count;
|
||||
+ geometry->outline.vertex_count += other_geom->outline.vertex_count;
|
||||
+ geometry->outline.face_count += other_geom->outline.face_count;
|
||||
+ geometry->outline.bezier_count += other_geom->outline.bezier_count;
|
||||
+ geometry->outline.bezier_face_count += other_geom->outline.bezier_face_count;
|
||||
+ geometry->outline.arc_count += other_geom->outline.arc_count;
|
||||
+ geometry->outline.arc_face_count += other_geom->outline.arc_face_count;
|
||||
}
|
||||
geometry->u.group.geometry_count = geometry_count;
|
||||
geometry->u.group.fill_mode = fill_mode;
|
||||
|
||||
+ if (!(geometry->fill.vertices = calloc(geometry->fill.vertex_count, sizeof(D2D1_POINT_2F))))
|
||||
+ {
|
||||
+ for (i = 0; i < geometry->u.group.geometry_count; ++i)
|
||||
+ ID2D1Geometry_Release(geometry->u.group.src_geometries[i]);
|
||||
+ d2d_geometry_cleanup(geometry);
|
||||
+ return E_OUTOFMEMORY;
|
||||
+ }
|
||||
+ if (!(geometry->fill.faces = calloc(geometry->fill.face_count, sizeof(struct d2d_face))))
|
||||
+ {
|
||||
+ for (i = 0; i < geometry->u.group.geometry_count; ++i)
|
||||
+ ID2D1Geometry_Release(geometry->u.group.src_geometries[i]);
|
||||
+ d2d_geometry_cleanup(geometry);
|
||||
+ return E_OUTOFMEMORY;
|
||||
+ }
|
||||
+ geometry->fill.faces_size = geometry->fill.face_count;
|
||||
+ if (!(geometry->fill.bezier_vertices = calloc(geometry->fill.bezier_vertex_count, sizeof(struct d2d_curve_vertex))))
|
||||
+ {
|
||||
+ for (i = 0; i < geometry->u.group.geometry_count; ++i)
|
||||
+ ID2D1Geometry_Release(geometry->u.group.src_geometries[i]);
|
||||
+ d2d_geometry_cleanup(geometry);
|
||||
+ return E_OUTOFMEMORY;
|
||||
+ }
|
||||
+ geometry->fill.bezier_vertices_size = geometry->fill.bezier_vertex_count;
|
||||
+ if (!(geometry->fill.arc_vertices = calloc(geometry->fill.arc_vertex_count, sizeof(struct d2d_curve_vertex))))
|
||||
+ {
|
||||
+ for (i = 0; i < geometry->u.group.geometry_count; ++i)
|
||||
+ ID2D1Geometry_Release(geometry->u.group.src_geometries[i]);
|
||||
+ d2d_geometry_cleanup(geometry);
|
||||
+ return E_OUTOFMEMORY;
|
||||
+ }
|
||||
+ geometry->fill.arc_vertices_size = geometry->fill.arc_vertex_count;
|
||||
+ if (!(geometry->outline.vertices = calloc(geometry->outline.vertex_count, sizeof(struct d2d_outline_vertex))))
|
||||
+ {
|
||||
+ for (i = 0; i < geometry->u.group.geometry_count; ++i)
|
||||
+ ID2D1Geometry_Release(geometry->u.group.src_geometries[i]);
|
||||
+ d2d_geometry_cleanup(geometry);
|
||||
+ return E_OUTOFMEMORY;
|
||||
+ }
|
||||
+ geometry->outline.vertices_size = geometry->outline.vertex_count;
|
||||
+ if (!(geometry->outline.faces = calloc(geometry->outline.face_count, sizeof(struct d2d_face))))
|
||||
+ {
|
||||
+ for (i = 0; i < geometry->u.group.geometry_count; ++i)
|
||||
+ ID2D1Geometry_Release(geometry->u.group.src_geometries[i]);
|
||||
+ d2d_geometry_cleanup(geometry);
|
||||
+ return E_OUTOFMEMORY;
|
||||
+ }
|
||||
+ geometry->outline.faces_size = geometry->outline.face_count;
|
||||
+ if (!(geometry->outline.beziers = calloc(geometry->outline.bezier_count, sizeof(struct d2d_curve_outline_vertex))))
|
||||
+ {
|
||||
+ for (i = 0; i < geometry->u.group.geometry_count; ++i)
|
||||
+ ID2D1Geometry_Release(geometry->u.group.src_geometries[i]);
|
||||
+ d2d_geometry_cleanup(geometry);
|
||||
+ return E_OUTOFMEMORY;
|
||||
+ }
|
||||
+ geometry->outline.beziers_size = geometry->outline.bezier_count;
|
||||
+ if (!(geometry->outline.bezier_faces = calloc(geometry->outline.bezier_face_count, sizeof(struct d2d_face))))
|
||||
+ {
|
||||
+ for (i = 0; i < geometry->u.group.geometry_count; ++i)
|
||||
+ ID2D1Geometry_Release(geometry->u.group.src_geometries[i]);
|
||||
+ d2d_geometry_cleanup(geometry);
|
||||
+ return E_OUTOFMEMORY;
|
||||
+ }
|
||||
+ geometry->outline.bezier_faces_size = geometry->outline.bezier_face_count;
|
||||
+ if (!(geometry->outline.arcs = calloc(geometry->outline.arc_count, sizeof(struct d2d_curve_outline_vertex))))
|
||||
+ {
|
||||
+ for (i = 0; i < geometry->u.group.geometry_count; ++i)
|
||||
+ ID2D1Geometry_Release(geometry->u.group.src_geometries[i]);
|
||||
+ d2d_geometry_cleanup(geometry);
|
||||
+ return E_OUTOFMEMORY;
|
||||
+ }
|
||||
+ geometry->outline.arcs_size = geometry->outline.arc_count;
|
||||
+ if (!(geometry->outline.arc_faces = calloc(geometry->outline.arc_face_count, sizeof(struct d2d_face))))
|
||||
+ {
|
||||
+ for (i = 0; i < geometry->u.group.geometry_count; ++i)
|
||||
+ ID2D1Geometry_Release(geometry->u.group.src_geometries[i]);
|
||||
+ d2d_geometry_cleanup(geometry);
|
||||
+ return E_OUTOFMEMORY;
|
||||
+ }
|
||||
+ geometry->outline.arc_faces_size = geometry->outline.arc_face_count;
|
||||
+
|
||||
+ f_vertex_count = 0;
|
||||
+ f_face_count = 0;
|
||||
+ f_bezier_vertex_count = 0;
|
||||
+ f_arc_vertex_count = 0;
|
||||
+ o_vertex_count = 0;
|
||||
+ o_face_count = 0;
|
||||
+ o_bezier_count = 0;
|
||||
+ o_bezier_face_count = 0;
|
||||
+ o_arc_count = 0;
|
||||
+ o_arc_face_count = 0;
|
||||
+ for (i = 0; i < geometry_count; ++i)
|
||||
+ {
|
||||
+ other_geom = unsafe_impl_from_ID2D1Geometry(geometries[i]);
|
||||
+ g = other_geom->transform;
|
||||
+ gplain = g;
|
||||
+ gplain.dx = 0.0f;
|
||||
+ gplain.dy = 0.0f;
|
||||
+
|
||||
+ for (j = 0; j < other_geom->fill.vertex_count; ++j) {
|
||||
+ d2d_point_transform(&geometry->fill.vertices[j+f_vertex_count], &g,
|
||||
+ other_geom->fill.vertices[j].x, other_geom->fill.vertices[j].y);
|
||||
+ }
|
||||
+ for (j = 0; j < other_geom->fill.face_count; ++j) {
|
||||
+ geometry->fill.faces[f_face_count+j].v[0] = other_geom->fill.faces[j].v[0]
|
||||
+ + (UINT16) f_vertex_count;
|
||||
+ geometry->fill.faces[f_face_count+j].v[1] = other_geom->fill.faces[j].v[1]
|
||||
+ + (UINT16) f_vertex_count;
|
||||
+ geometry->fill.faces[f_face_count+j].v[2] = other_geom->fill.faces[j].v[2]
|
||||
+ + (UINT16) f_vertex_count;
|
||||
+ }
|
||||
+ f_vertex_count += other_geom->fill.vertex_count;
|
||||
+ f_face_count += other_geom->fill.face_count;
|
||||
+
|
||||
+ for (j = 0; j < other_geom->fill.bezier_vertex_count; ++j) {
|
||||
+ d2d_point_transform(&geometry->fill.bezier_vertices[j+f_bezier_vertex_count].position,
|
||||
+ &g, other_geom->fill.bezier_vertices[j].position.x,
|
||||
+ other_geom->fill.bezier_vertices[j].position.y);
|
||||
+ geometry->fill.bezier_vertices[j+f_bezier_vertex_count].texcoord
|
||||
+ = other_geom->fill.bezier_vertices[j].texcoord;
|
||||
+ }
|
||||
+ f_bezier_vertex_count += other_geom->fill.bezier_vertex_count;
|
||||
+
|
||||
+ for (j = 0; j < other_geom->fill.arc_vertex_count; ++j) {
|
||||
+ d2d_point_transform(&geometry->fill.arc_vertices[j+f_arc_vertex_count].position,
|
||||
+ &g, other_geom->fill.arc_vertices[j].position.x,
|
||||
+ other_geom->fill.arc_vertices[j].position.y);
|
||||
+ geometry->fill.arc_vertices[j+f_arc_vertex_count].texcoord
|
||||
+ = other_geom->fill.arc_vertices[j].texcoord;
|
||||
+
|
||||
+ }
|
||||
+ f_arc_vertex_count += other_geom->fill.arc_vertex_count;
|
||||
+
|
||||
+ for (j = 0; j < other_geom->outline.vertex_count; ++j) {
|
||||
+ d2d_point_transform(&geometry->outline.vertices[j+o_vertex_count].position, &g,
|
||||
+ other_geom->outline.vertices[j].position.x, other_geom->outline.vertices[j].position.y);
|
||||
+ d2d_point_transform(&geometry->outline.vertices[j+o_vertex_count].prev, &gplain,
|
||||
+ other_geom->outline.vertices[j].prev.x, other_geom->outline.vertices[j].prev.y);
|
||||
+ d2d_point_normalise(&geometry->outline.vertices[j+o_vertex_count].prev);
|
||||
+ d2d_point_transform(&geometry->outline.vertices[j+o_vertex_count].next, &gplain,
|
||||
+ other_geom->outline.vertices[j].next.x, other_geom->outline.vertices[j].next.y);
|
||||
+ d2d_point_normalise(&geometry->outline.vertices[j+o_vertex_count].next);
|
||||
+ }
|
||||
+ for (j = 0; j < other_geom->outline.face_count; ++j) {
|
||||
+ geometry->outline.faces[o_face_count+j].v[0] = other_geom->outline.faces[j].v[0]
|
||||
+ + (UINT16) o_vertex_count;
|
||||
+ geometry->outline.faces[o_face_count+j].v[1] = other_geom->outline.faces[j].v[1]
|
||||
+ + (UINT16) o_vertex_count;
|
||||
+ geometry->outline.faces[o_face_count+j].v[2] = other_geom->outline.faces[j].v[2]
|
||||
+ + (UINT16) o_vertex_count;
|
||||
+ }
|
||||
+ o_vertex_count += other_geom->outline.vertex_count;
|
||||
+ o_face_count += other_geom->outline.face_count;
|
||||
+
|
||||
+ for (j = 0; j < other_geom->outline.bezier_count; ++j) {
|
||||
+ d2d_point_transform(&geometry->outline.beziers[j+o_bezier_count].position, &g,
|
||||
+ other_geom->outline.beziers[j].position.x, other_geom->outline.beziers[j].position.y);
|
||||
+ d2d_point_transform(&geometry->outline.beziers[j+o_bezier_count].prev, &gplain,
|
||||
+ other_geom->outline.beziers[j].prev.x, other_geom->outline.beziers[j].prev.y);
|
||||
+ d2d_point_normalise(&geometry->outline.beziers[j+o_bezier_count].prev);
|
||||
+ d2d_point_transform(&geometry->outline.beziers[j+o_bezier_count].next, &gplain,
|
||||
+ other_geom->outline.beziers[j].next.x, other_geom->outline.beziers[j].next.y);
|
||||
+ d2d_point_normalise(&geometry->outline.beziers[j+o_bezier_count].next);
|
||||
+ d2d_point_transform(&geometry->outline.beziers[j+o_bezier_count].p0, &g,
|
||||
+ other_geom->outline.beziers[j].p0.x, other_geom->outline.beziers[j].p0.y);
|
||||
+ d2d_point_transform(&geometry->outline.beziers[j+o_bezier_count].p1, &g,
|
||||
+ other_geom->outline.beziers[j].p1.x, other_geom->outline.beziers[j].p1.y);
|
||||
+ d2d_point_transform(&geometry->outline.beziers[j+o_bezier_count].p2, &g,
|
||||
+ other_geom->outline.beziers[j].p2.x, other_geom->outline.beziers[j].p2.y);
|
||||
+ }
|
||||
+ for (j = 0; j < other_geom->outline.bezier_face_count; ++j) {
|
||||
+ geometry->outline.bezier_faces[o_bezier_face_count+j].v[0]
|
||||
+ = other_geom->outline.bezier_faces[j].v[0] + (UINT16) o_bezier_count;
|
||||
+ geometry->outline.bezier_faces[o_bezier_face_count+j].v[1]
|
||||
+ = other_geom->outline.bezier_faces[j].v[1] + (UINT16) o_bezier_count;
|
||||
+ geometry->outline.bezier_faces[o_bezier_face_count+j].v[2]
|
||||
+ = other_geom->outline.bezier_faces[j].v[2] + (UINT16) o_bezier_count;
|
||||
+ }
|
||||
+ o_bezier_count += other_geom->outline.bezier_count;
|
||||
+ o_bezier_face_count += other_geom->outline.bezier_face_count;
|
||||
+
|
||||
+ for (j = 0; j < other_geom->outline.arc_count; ++j) {
|
||||
+ d2d_point_transform(&geometry->outline.arcs[j+o_arc_count].position, &g,
|
||||
+ other_geom->outline.arcs[j].position.x, other_geom->outline.arcs[j].position.y);
|
||||
+ d2d_point_transform(&geometry->outline.arcs[j+o_arc_count].prev, &gplain,
|
||||
+ other_geom->outline.arcs[j].prev.x, other_geom->outline.arcs[j].prev.y);
|
||||
+ d2d_point_normalise(&geometry->outline.arcs[j+o_arc_count].prev);
|
||||
+ d2d_point_transform(&geometry->outline.arcs[j+o_arc_count].next, &gplain,
|
||||
+ other_geom->outline.arcs[j].next.x, other_geom->outline.arcs[j].next.y);
|
||||
+ d2d_point_normalise(&geometry->outline.arcs[j+o_arc_count].next);
|
||||
+ d2d_point_transform(&geometry->outline.arcs[j+o_arc_count].p0, &g,
|
||||
+ other_geom->outline.arcs[j].p0.x, other_geom->outline.arcs[j].p0.y);
|
||||
+ d2d_point_transform(&geometry->outline.arcs[j+o_arc_count].p1, &g,
|
||||
+ other_geom->outline.arcs[j].p1.x, other_geom->outline.arcs[j].p1.y);
|
||||
+ d2d_point_transform(&geometry->outline.arcs[j+o_arc_count].p2, &g,
|
||||
+ other_geom->outline.arcs[j].p2.x, other_geom->outline.arcs[j].p2.y);
|
||||
+ }
|
||||
+ for (j = 0; j < other_geom->outline.arc_face_count; ++j) {
|
||||
+ geometry->outline.arc_faces[o_arc_face_count+j].v[0]
|
||||
+ = other_geom->outline.arc_faces[j].v[0] + (UINT16) o_arc_count;
|
||||
+ geometry->outline.arc_faces[o_arc_face_count+j].v[1]
|
||||
+ = other_geom->outline.arc_faces[j].v[1] + (UINT16) o_arc_count;
|
||||
+ geometry->outline.arc_faces[o_arc_face_count+j].v[2]
|
||||
+ = other_geom->outline.arc_faces[j].v[2] + (UINT16) o_arc_count;
|
||||
+ }
|
||||
+ o_arc_count += other_geom->outline.arc_count;
|
||||
+ o_arc_face_count += other_geom->outline.arc_face_count;
|
||||
+ }
|
||||
+
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
--
|
||||
2.45.2
|
||||
|
3
patches/d2d1_ID2D1GeometryGroup/definition
Normal file
3
patches/d2d1_ID2D1GeometryGroup/definition
Normal file
@@ -0,0 +1,3 @@
|
||||
Fixes: [51139] d2d1: Implement drawing of ID2D1GeometryGroup
|
||||
|
||||
# MR https://gitlab.winehq.org/wine/wine/-/merge_requests/6492
|
@@ -1,24 +0,0 @@
|
||||
From 170a6d9df910f617585791df31aa72b79622ed0b Mon Sep 17 00:00:00 2001
|
||||
From: Christian Costa <titan.costa@gmail.com>
|
||||
Date: Mon, 16 May 2016 13:20:39 +0200
|
||||
Subject: d3dx9_36: Add format description for X8L8V8U8 for format conversions.
|
||||
|
||||
---
|
||||
dlls/d3dx9_36/util.c | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/dlls/d3dx9_36/util.c b/dlls/d3dx9_36/util.c
|
||||
index d8cd43a..12b9c2c 100644
|
||||
--- a/dlls/d3dx9_36/util.c
|
||||
+++ b/dlls/d3dx9_36/util.c
|
||||
@@ -90,6 +90,7 @@ static const struct pixel_format_desc formats[] =
|
||||
{D3DFMT_G32R32F, { 0, 32, 32, 0}, { 0, 0, 32, 0}, 8, 1, 1, 8, FORMAT_ARGBF, NULL, NULL },
|
||||
{D3DFMT_A32B32G32R32F, {32, 32, 32, 32}, {96, 0, 32, 64}, 16, 1, 1, 16, FORMAT_ARGBF, NULL, NULL },
|
||||
{D3DFMT_P8, { 8, 8, 8, 8}, { 0, 0, 0, 0}, 1, 1, 1, 1, FORMAT_INDEX, NULL, index_to_rgba},
|
||||
+ {D3DFMT_X8L8V8U8, { 0, 8, 8, 8}, { 0, 0, 8, 16}, 4, 1, 1, 4, FORMAT_ARGB, NULL, NULL },
|
||||
/* marks last element */
|
||||
{D3DFMT_UNKNOWN, { 0, 0, 0, 0}, { 0, 0, 0, 0}, 0, 1, 1, 0, FORMAT_UNKNOWN, NULL, NULL },
|
||||
};
|
||||
--
|
||||
2.8.0
|
||||
|
@@ -1 +0,0 @@
|
||||
Fixes: Recognize bump luminance X8L8V8U8 when loading dds file
|
@@ -1,371 +0,0 @@
|
||||
From 3eb7b781849135fefeece9ca257ca9673b1545fd Mon Sep 17 00:00:00 2001
|
||||
From: Christian Costa <titan.costa@gmail.com>
|
||||
Date: Sun, 16 Jul 2017 18:13:31 +0200
|
||||
Subject: d3dx9_36: Add semi-stub for D3DXOptimizeVertices.
|
||||
|
||||
---
|
||||
dlls/d3dx9_24/d3dx9_24.spec | 2 +-
|
||||
dlls/d3dx9_25/d3dx9_25.spec | 2 +-
|
||||
dlls/d3dx9_26/d3dx9_26.spec | 2 +-
|
||||
dlls/d3dx9_27/d3dx9_27.spec | 2 +-
|
||||
dlls/d3dx9_28/d3dx9_28.spec | 2 +-
|
||||
dlls/d3dx9_29/d3dx9_29.spec | 2 +-
|
||||
dlls/d3dx9_30/d3dx9_30.spec | 2 +-
|
||||
dlls/d3dx9_31/d3dx9_31.spec | 2 +-
|
||||
dlls/d3dx9_32/d3dx9_32.spec | 2 +-
|
||||
dlls/d3dx9_33/d3dx9_33.spec | 2 +-
|
||||
dlls/d3dx9_34/d3dx9_34.spec | 2 +-
|
||||
dlls/d3dx9_35/d3dx9_35.spec | 2 +-
|
||||
dlls/d3dx9_36/d3dx9_36.spec | 2 +-
|
||||
dlls/d3dx9_36/mesh.c | 27 +++++++++++++++++++++++++++
|
||||
dlls/d3dx9_36/tests/mesh.c | 22 ++++++++++++++++++++++
|
||||
dlls/d3dx9_37/d3dx9_37.spec | 2 +-
|
||||
dlls/d3dx9_38/d3dx9_38.spec | 2 +-
|
||||
dlls/d3dx9_39/d3dx9_39.spec | 2 +-
|
||||
dlls/d3dx9_40/d3dx9_40.spec | 2 +-
|
||||
dlls/d3dx9_41/d3dx9_41.spec | 2 +-
|
||||
dlls/d3dx9_42/d3dx9_42.spec | 2 +-
|
||||
dlls/d3dx9_43/d3dx9_43.spec | 2 +-
|
||||
22 files changed, 69 insertions(+), 20 deletions(-)
|
||||
|
||||
diff --git a/dlls/d3dx9_24/d3dx9_24.spec b/dlls/d3dx9_24/d3dx9_24.spec
|
||||
index 0ca8777efe6..9b52c2bf307 100644
|
||||
--- a/dlls/d3dx9_24/d3dx9_24.spec
|
||||
+++ b/dlls/d3dx9_24/d3dx9_24.spec
|
||||
@@ -226,7 +226,7 @@
|
||||
@ stdcall D3DXMatrixTranslation(ptr float float float)
|
||||
@ stdcall D3DXMatrixTranspose(ptr ptr)
|
||||
@ stdcall D3DXOptimizeFaces(ptr long long long ptr)
|
||||
-@ stub D3DXOptimizeVertices(ptr long long long ptr)
|
||||
+@ stdcall D3DXOptimizeVertices(ptr long long long ptr)
|
||||
@ stdcall D3DXPlaneFromPointNormal(ptr ptr ptr)
|
||||
@ stdcall D3DXPlaneFromPoints(ptr ptr ptr ptr)
|
||||
@ stdcall D3DXPlaneIntersectLine(ptr ptr ptr ptr)
|
||||
diff --git a/dlls/d3dx9_25/d3dx9_25.spec b/dlls/d3dx9_25/d3dx9_25.spec
|
||||
index a5449810a43..fc75dfd9c04 100644
|
||||
--- a/dlls/d3dx9_25/d3dx9_25.spec
|
||||
+++ b/dlls/d3dx9_25/d3dx9_25.spec
|
||||
@@ -226,7 +226,7 @@
|
||||
@ stdcall D3DXMatrixTranslation(ptr float float float)
|
||||
@ stdcall D3DXMatrixTranspose(ptr ptr)
|
||||
@ stdcall D3DXOptimizeFaces(ptr long long long ptr)
|
||||
-@ stub D3DXOptimizeVertices(ptr long long long ptr)
|
||||
+@ stdcall D3DXOptimizeVertices(ptr long long long ptr)
|
||||
@ stdcall D3DXPlaneFromPointNormal(ptr ptr ptr)
|
||||
@ stdcall D3DXPlaneFromPoints(ptr ptr ptr ptr)
|
||||
@ stdcall D3DXPlaneIntersectLine(ptr ptr ptr ptr)
|
||||
diff --git a/dlls/d3dx9_26/d3dx9_26.spec b/dlls/d3dx9_26/d3dx9_26.spec
|
||||
index 9e1200442f4..85d9fc5332e 100644
|
||||
--- a/dlls/d3dx9_26/d3dx9_26.spec
|
||||
+++ b/dlls/d3dx9_26/d3dx9_26.spec
|
||||
@@ -230,7 +230,7 @@
|
||||
@ stdcall D3DXMatrixTranslation(ptr float float float)
|
||||
@ stdcall D3DXMatrixTranspose(ptr ptr)
|
||||
@ stdcall D3DXOptimizeFaces(ptr long long long ptr)
|
||||
-@ stub D3DXOptimizeVertices(ptr long long long ptr)
|
||||
+@ stdcall D3DXOptimizeVertices(ptr long long long ptr)
|
||||
@ stdcall D3DXPlaneFromPointNormal(ptr ptr ptr)
|
||||
@ stdcall D3DXPlaneFromPoints(ptr ptr ptr ptr)
|
||||
@ stdcall D3DXPlaneIntersectLine(ptr ptr ptr ptr)
|
||||
diff --git a/dlls/d3dx9_27/d3dx9_27.spec b/dlls/d3dx9_27/d3dx9_27.spec
|
||||
index 9e1200442f4..85d9fc5332e 100644
|
||||
--- a/dlls/d3dx9_27/d3dx9_27.spec
|
||||
+++ b/dlls/d3dx9_27/d3dx9_27.spec
|
||||
@@ -230,7 +230,7 @@
|
||||
@ stdcall D3DXMatrixTranslation(ptr float float float)
|
||||
@ stdcall D3DXMatrixTranspose(ptr ptr)
|
||||
@ stdcall D3DXOptimizeFaces(ptr long long long ptr)
|
||||
-@ stub D3DXOptimizeVertices(ptr long long long ptr)
|
||||
+@ stdcall D3DXOptimizeVertices(ptr long long long ptr)
|
||||
@ stdcall D3DXPlaneFromPointNormal(ptr ptr ptr)
|
||||
@ stdcall D3DXPlaneFromPoints(ptr ptr ptr ptr)
|
||||
@ stdcall D3DXPlaneIntersectLine(ptr ptr ptr ptr)
|
||||
diff --git a/dlls/d3dx9_28/d3dx9_28.spec b/dlls/d3dx9_28/d3dx9_28.spec
|
||||
index b316a23baf1..62673ccd7af 100644
|
||||
--- a/dlls/d3dx9_28/d3dx9_28.spec
|
||||
+++ b/dlls/d3dx9_28/d3dx9_28.spec
|
||||
@@ -230,7 +230,7 @@
|
||||
@ stdcall D3DXMatrixTranslation(ptr float float float)
|
||||
@ stdcall D3DXMatrixTranspose(ptr ptr)
|
||||
@ stdcall D3DXOptimizeFaces(ptr long long long ptr)
|
||||
-@ stub D3DXOptimizeVertices(ptr long long long ptr)
|
||||
+@ stdcall D3DXOptimizeVertices(ptr long long long ptr)
|
||||
@ stdcall D3DXPlaneFromPointNormal(ptr ptr ptr)
|
||||
@ stdcall D3DXPlaneFromPoints(ptr ptr ptr ptr)
|
||||
@ stdcall D3DXPlaneIntersectLine(ptr ptr ptr ptr)
|
||||
diff --git a/dlls/d3dx9_29/d3dx9_29.spec b/dlls/d3dx9_29/d3dx9_29.spec
|
||||
index b316a23baf1..62673ccd7af 100644
|
||||
--- a/dlls/d3dx9_29/d3dx9_29.spec
|
||||
+++ b/dlls/d3dx9_29/d3dx9_29.spec
|
||||
@@ -230,7 +230,7 @@
|
||||
@ stdcall D3DXMatrixTranslation(ptr float float float)
|
||||
@ stdcall D3DXMatrixTranspose(ptr ptr)
|
||||
@ stdcall D3DXOptimizeFaces(ptr long long long ptr)
|
||||
-@ stub D3DXOptimizeVertices(ptr long long long ptr)
|
||||
+@ stdcall D3DXOptimizeVertices(ptr long long long ptr)
|
||||
@ stdcall D3DXPlaneFromPointNormal(ptr ptr ptr)
|
||||
@ stdcall D3DXPlaneFromPoints(ptr ptr ptr ptr)
|
||||
@ stdcall D3DXPlaneIntersectLine(ptr ptr ptr ptr)
|
||||
diff --git a/dlls/d3dx9_30/d3dx9_30.spec b/dlls/d3dx9_30/d3dx9_30.spec
|
||||
index e00fa547862..2c7575d88fc 100644
|
||||
--- a/dlls/d3dx9_30/d3dx9_30.spec
|
||||
+++ b/dlls/d3dx9_30/d3dx9_30.spec
|
||||
@@ -230,7 +230,7 @@
|
||||
@ stdcall D3DXMatrixTranslation(ptr float float float)
|
||||
@ stdcall D3DXMatrixTranspose(ptr ptr)
|
||||
@ stdcall D3DXOptimizeFaces(ptr long long long ptr)
|
||||
-@ stub D3DXOptimizeVertices(ptr long long long ptr)
|
||||
+@ stdcall D3DXOptimizeVertices(ptr long long long ptr)
|
||||
@ stdcall D3DXPlaneFromPointNormal(ptr ptr ptr)
|
||||
@ stdcall D3DXPlaneFromPoints(ptr ptr ptr ptr)
|
||||
@ stdcall D3DXPlaneIntersectLine(ptr ptr ptr ptr)
|
||||
diff --git a/dlls/d3dx9_31/d3dx9_31.spec b/dlls/d3dx9_31/d3dx9_31.spec
|
||||
index d308939ef67..a41eb3e9af2 100644
|
||||
--- a/dlls/d3dx9_31/d3dx9_31.spec
|
||||
+++ b/dlls/d3dx9_31/d3dx9_31.spec
|
||||
@@ -227,7 +227,7 @@
|
||||
@ stdcall D3DXMatrixTranslation(ptr float float float)
|
||||
@ stdcall D3DXMatrixTranspose(ptr ptr)
|
||||
@ stdcall D3DXOptimizeFaces(ptr long long long ptr)
|
||||
-@ stub D3DXOptimizeVertices(ptr long long long ptr)
|
||||
+@ stdcall D3DXOptimizeVertices(ptr long long long ptr)
|
||||
@ stdcall D3DXPlaneFromPointNormal(ptr ptr ptr)
|
||||
@ stdcall D3DXPlaneFromPoints(ptr ptr ptr ptr)
|
||||
@ stdcall D3DXPlaneIntersectLine(ptr ptr ptr ptr)
|
||||
diff --git a/dlls/d3dx9_32/d3dx9_32.spec b/dlls/d3dx9_32/d3dx9_32.spec
|
||||
index c2292dff396..eab56b3c9ee 100644
|
||||
--- a/dlls/d3dx9_32/d3dx9_32.spec
|
||||
+++ b/dlls/d3dx9_32/d3dx9_32.spec
|
||||
@@ -227,7 +227,7 @@
|
||||
@ stdcall D3DXMatrixTranslation(ptr float float float)
|
||||
@ stdcall D3DXMatrixTranspose(ptr ptr)
|
||||
@ stdcall D3DXOptimizeFaces(ptr long long long ptr)
|
||||
-@ stub D3DXOptimizeVertices(ptr long long long ptr)
|
||||
+@ stdcall D3DXOptimizeVertices(ptr long long long ptr)
|
||||
@ stdcall D3DXPlaneFromPointNormal(ptr ptr ptr)
|
||||
@ stdcall D3DXPlaneFromPoints(ptr ptr ptr ptr)
|
||||
@ stdcall D3DXPlaneIntersectLine(ptr ptr ptr ptr)
|
||||
diff --git a/dlls/d3dx9_33/d3dx9_33.spec b/dlls/d3dx9_33/d3dx9_33.spec
|
||||
index c2292dff396..eab56b3c9ee 100644
|
||||
--- a/dlls/d3dx9_33/d3dx9_33.spec
|
||||
+++ b/dlls/d3dx9_33/d3dx9_33.spec
|
||||
@@ -227,7 +227,7 @@
|
||||
@ stdcall D3DXMatrixTranslation(ptr float float float)
|
||||
@ stdcall D3DXMatrixTranspose(ptr ptr)
|
||||
@ stdcall D3DXOptimizeFaces(ptr long long long ptr)
|
||||
-@ stub D3DXOptimizeVertices(ptr long long long ptr)
|
||||
+@ stdcall D3DXOptimizeVertices(ptr long long long ptr)
|
||||
@ stdcall D3DXPlaneFromPointNormal(ptr ptr ptr)
|
||||
@ stdcall D3DXPlaneFromPoints(ptr ptr ptr ptr)
|
||||
@ stdcall D3DXPlaneIntersectLine(ptr ptr ptr ptr)
|
||||
diff --git a/dlls/d3dx9_34/d3dx9_34.spec b/dlls/d3dx9_34/d3dx9_34.spec
|
||||
index c2292dff396..eab56b3c9ee 100644
|
||||
--- a/dlls/d3dx9_34/d3dx9_34.spec
|
||||
+++ b/dlls/d3dx9_34/d3dx9_34.spec
|
||||
@@ -227,7 +227,7 @@
|
||||
@ stdcall D3DXMatrixTranslation(ptr float float float)
|
||||
@ stdcall D3DXMatrixTranspose(ptr ptr)
|
||||
@ stdcall D3DXOptimizeFaces(ptr long long long ptr)
|
||||
-@ stub D3DXOptimizeVertices(ptr long long long ptr)
|
||||
+@ stdcall D3DXOptimizeVertices(ptr long long long ptr)
|
||||
@ stdcall D3DXPlaneFromPointNormal(ptr ptr ptr)
|
||||
@ stdcall D3DXPlaneFromPoints(ptr ptr ptr ptr)
|
||||
@ stdcall D3DXPlaneIntersectLine(ptr ptr ptr ptr)
|
||||
diff --git a/dlls/d3dx9_35/d3dx9_35.spec b/dlls/d3dx9_35/d3dx9_35.spec
|
||||
index c2292dff396..eab56b3c9ee 100644
|
||||
--- a/dlls/d3dx9_35/d3dx9_35.spec
|
||||
+++ b/dlls/d3dx9_35/d3dx9_35.spec
|
||||
@@ -227,7 +227,7 @@
|
||||
@ stdcall D3DXMatrixTranslation(ptr float float float)
|
||||
@ stdcall D3DXMatrixTranspose(ptr ptr)
|
||||
@ stdcall D3DXOptimizeFaces(ptr long long long ptr)
|
||||
-@ stub D3DXOptimizeVertices(ptr long long long ptr)
|
||||
+@ stdcall D3DXOptimizeVertices(ptr long long long ptr)
|
||||
@ stdcall D3DXPlaneFromPointNormal(ptr ptr ptr)
|
||||
@ stdcall D3DXPlaneFromPoints(ptr ptr ptr ptr)
|
||||
@ stdcall D3DXPlaneIntersectLine(ptr ptr ptr ptr)
|
||||
diff --git a/dlls/d3dx9_36/d3dx9_36.spec b/dlls/d3dx9_36/d3dx9_36.spec
|
||||
index 0fdf4e135e1..6201657d4a5 100644
|
||||
--- a/dlls/d3dx9_36/d3dx9_36.spec
|
||||
+++ b/dlls/d3dx9_36/d3dx9_36.spec
|
||||
@@ -229,7 +229,7 @@
|
||||
@ stdcall D3DXMatrixTranslation(ptr float float float)
|
||||
@ stdcall D3DXMatrixTranspose(ptr ptr)
|
||||
@ stdcall D3DXOptimizeFaces(ptr long long long ptr)
|
||||
-@ stub D3DXOptimizeVertices(ptr long long long ptr)
|
||||
+@ stdcall D3DXOptimizeVertices(ptr long long long ptr)
|
||||
@ stdcall D3DXPlaneFromPointNormal(ptr ptr ptr)
|
||||
@ stdcall D3DXPlaneFromPoints(ptr ptr ptr ptr)
|
||||
@ stdcall D3DXPlaneIntersectLine(ptr ptr ptr ptr)
|
||||
diff --git a/dlls/d3dx9_36/mesh.c b/dlls/d3dx9_36/mesh.c
|
||||
index 6294ce624fe..12cb7eb7258 100644
|
||||
--- a/dlls/d3dx9_36/mesh.c
|
||||
+++ b/dlls/d3dx9_36/mesh.c
|
||||
@@ -7184,6 +7184,33 @@ cleanup:
|
||||
return hr;
|
||||
}
|
||||
|
||||
+
|
||||
+/*************************************************************************
|
||||
+ * D3DXOptimizeVertices (D3DX9_36.@)
|
||||
+ */
|
||||
+HRESULT WINAPI D3DXOptimizeVertices(const void *indices, UINT num_faces,
|
||||
+ UINT num_vertices, BOOL indices_are_32bit, DWORD *vertex_remap)
|
||||
+{
|
||||
+ UINT i;
|
||||
+
|
||||
+ FIXME("indices %p, num_faces %u, num_vertices %u, indices_are_32bit %#x, vertex_remap %p semi-stub.\n",
|
||||
+ indices, num_faces, num_vertices, indices_are_32bit, vertex_remap);
|
||||
+
|
||||
+ if (!vertex_remap)
|
||||
+ {
|
||||
+ WARN("vertex remap pointer is NULL.\n");
|
||||
+ return D3DERR_INVALIDCALL;
|
||||
+ }
|
||||
+
|
||||
+ for (i = 0; i < num_vertices; i++)
|
||||
+ {
|
||||
+ vertex_remap[i] = i;
|
||||
+ }
|
||||
+
|
||||
+ return D3D_OK;
|
||||
+}
|
||||
+
|
||||
+
|
||||
/*************************************************************************
|
||||
* D3DXOptimizeFaces (D3DX9_36.@)
|
||||
*
|
||||
diff --git a/dlls/d3dx9_36/tests/mesh.c b/dlls/d3dx9_36/tests/mesh.c
|
||||
index f437a83cbd8..c5faae520c9 100644
|
||||
--- a/dlls/d3dx9_36/tests/mesh.c
|
||||
+++ b/dlls/d3dx9_36/tests/mesh.c
|
||||
@@ -10403,6 +10403,27 @@ cleanup:
|
||||
free_test_context(test_context);
|
||||
}
|
||||
|
||||
+static void test_optimize_vertices(void)
|
||||
+{
|
||||
+ HRESULT hr;
|
||||
+ DWORD vertex_remap[3];
|
||||
+ const DWORD indices[] = {0, 1, 2};
|
||||
+ const UINT num_faces = 1;
|
||||
+ const UINT num_vertices = 3;
|
||||
+
|
||||
+ hr = D3DXOptimizeVertices(indices, num_faces,
|
||||
+ num_vertices, FALSE,
|
||||
+ vertex_remap);
|
||||
+ ok(hr == D3D_OK, "D3DXOptimizeVertices failed. Got %lx, expected D3D_OK.\n", hr);
|
||||
+
|
||||
+ /* vertex_remap must not be NULL */
|
||||
+ hr = D3DXOptimizeVertices(indices, num_faces,
|
||||
+ num_vertices, FALSE,
|
||||
+ NULL);
|
||||
+ ok(hr == D3DERR_INVALIDCALL, "D3DXOptimizeVertices passed NULL vertex_remap "
|
||||
+ "pointer. Got %lx, expected D3DERR_INVALIDCALL.\n", hr);
|
||||
+}
|
||||
+
|
||||
static void test_optimize_faces(void)
|
||||
{
|
||||
HRESULT hr;
|
||||
@@ -11291,6 +11312,7 @@ START_TEST(mesh)
|
||||
test_weld_vertices();
|
||||
test_clone_mesh();
|
||||
test_valid_mesh();
|
||||
+ test_optimize_vertices();
|
||||
test_optimize_faces();
|
||||
test_compute_normals();
|
||||
test_D3DXFrameFind();
|
||||
diff --git a/dlls/d3dx9_37/d3dx9_37.spec b/dlls/d3dx9_37/d3dx9_37.spec
|
||||
index 0fdf4e135e1..6201657d4a5 100644
|
||||
--- a/dlls/d3dx9_37/d3dx9_37.spec
|
||||
+++ b/dlls/d3dx9_37/d3dx9_37.spec
|
||||
@@ -229,7 +229,7 @@
|
||||
@ stdcall D3DXMatrixTranslation(ptr float float float)
|
||||
@ stdcall D3DXMatrixTranspose(ptr ptr)
|
||||
@ stdcall D3DXOptimizeFaces(ptr long long long ptr)
|
||||
-@ stub D3DXOptimizeVertices(ptr long long long ptr)
|
||||
+@ stdcall D3DXOptimizeVertices(ptr long long long ptr)
|
||||
@ stdcall D3DXPlaneFromPointNormal(ptr ptr ptr)
|
||||
@ stdcall D3DXPlaneFromPoints(ptr ptr ptr ptr)
|
||||
@ stdcall D3DXPlaneIntersectLine(ptr ptr ptr ptr)
|
||||
diff --git a/dlls/d3dx9_38/d3dx9_38.spec b/dlls/d3dx9_38/d3dx9_38.spec
|
||||
index 0fdf4e135e1..6201657d4a5 100644
|
||||
--- a/dlls/d3dx9_38/d3dx9_38.spec
|
||||
+++ b/dlls/d3dx9_38/d3dx9_38.spec
|
||||
@@ -229,7 +229,7 @@
|
||||
@ stdcall D3DXMatrixTranslation(ptr float float float)
|
||||
@ stdcall D3DXMatrixTranspose(ptr ptr)
|
||||
@ stdcall D3DXOptimizeFaces(ptr long long long ptr)
|
||||
-@ stub D3DXOptimizeVertices(ptr long long long ptr)
|
||||
+@ stdcall D3DXOptimizeVertices(ptr long long long ptr)
|
||||
@ stdcall D3DXPlaneFromPointNormal(ptr ptr ptr)
|
||||
@ stdcall D3DXPlaneFromPoints(ptr ptr ptr ptr)
|
||||
@ stdcall D3DXPlaneIntersectLine(ptr ptr ptr ptr)
|
||||
diff --git a/dlls/d3dx9_39/d3dx9_39.spec b/dlls/d3dx9_39/d3dx9_39.spec
|
||||
index 0fdf4e135e1..6201657d4a5 100644
|
||||
--- a/dlls/d3dx9_39/d3dx9_39.spec
|
||||
+++ b/dlls/d3dx9_39/d3dx9_39.spec
|
||||
@@ -229,7 +229,7 @@
|
||||
@ stdcall D3DXMatrixTranslation(ptr float float float)
|
||||
@ stdcall D3DXMatrixTranspose(ptr ptr)
|
||||
@ stdcall D3DXOptimizeFaces(ptr long long long ptr)
|
||||
-@ stub D3DXOptimizeVertices(ptr long long long ptr)
|
||||
+@ stdcall D3DXOptimizeVertices(ptr long long long ptr)
|
||||
@ stdcall D3DXPlaneFromPointNormal(ptr ptr ptr)
|
||||
@ stdcall D3DXPlaneFromPoints(ptr ptr ptr ptr)
|
||||
@ stdcall D3DXPlaneIntersectLine(ptr ptr ptr ptr)
|
||||
diff --git a/dlls/d3dx9_40/d3dx9_40.spec b/dlls/d3dx9_40/d3dx9_40.spec
|
||||
index 0fdf4e135e1..6201657d4a5 100644
|
||||
--- a/dlls/d3dx9_40/d3dx9_40.spec
|
||||
+++ b/dlls/d3dx9_40/d3dx9_40.spec
|
||||
@@ -229,7 +229,7 @@
|
||||
@ stdcall D3DXMatrixTranslation(ptr float float float)
|
||||
@ stdcall D3DXMatrixTranspose(ptr ptr)
|
||||
@ stdcall D3DXOptimizeFaces(ptr long long long ptr)
|
||||
-@ stub D3DXOptimizeVertices(ptr long long long ptr)
|
||||
+@ stdcall D3DXOptimizeVertices(ptr long long long ptr)
|
||||
@ stdcall D3DXPlaneFromPointNormal(ptr ptr ptr)
|
||||
@ stdcall D3DXPlaneFromPoints(ptr ptr ptr ptr)
|
||||
@ stdcall D3DXPlaneIntersectLine(ptr ptr ptr ptr)
|
||||
diff --git a/dlls/d3dx9_41/d3dx9_41.spec b/dlls/d3dx9_41/d3dx9_41.spec
|
||||
index 0fdf4e135e1..6201657d4a5 100644
|
||||
--- a/dlls/d3dx9_41/d3dx9_41.spec
|
||||
+++ b/dlls/d3dx9_41/d3dx9_41.spec
|
||||
@@ -229,7 +229,7 @@
|
||||
@ stdcall D3DXMatrixTranslation(ptr float float float)
|
||||
@ stdcall D3DXMatrixTranspose(ptr ptr)
|
||||
@ stdcall D3DXOptimizeFaces(ptr long long long ptr)
|
||||
-@ stub D3DXOptimizeVertices(ptr long long long ptr)
|
||||
+@ stdcall D3DXOptimizeVertices(ptr long long long ptr)
|
||||
@ stdcall D3DXPlaneFromPointNormal(ptr ptr ptr)
|
||||
@ stdcall D3DXPlaneFromPoints(ptr ptr ptr ptr)
|
||||
@ stdcall D3DXPlaneIntersectLine(ptr ptr ptr ptr)
|
||||
diff --git a/dlls/d3dx9_42/d3dx9_42.spec b/dlls/d3dx9_42/d3dx9_42.spec
|
||||
index 2f2ac5fd619..7cfc439f84b 100644
|
||||
--- a/dlls/d3dx9_42/d3dx9_42.spec
|
||||
+++ b/dlls/d3dx9_42/d3dx9_42.spec
|
||||
@@ -222,7 +222,7 @@
|
||||
@ stdcall D3DXMatrixTranslation(ptr float float float)
|
||||
@ stdcall D3DXMatrixTranspose(ptr ptr)
|
||||
@ stdcall D3DXOptimizeFaces(ptr long long long ptr)
|
||||
-@ stub D3DXOptimizeVertices(ptr long long long ptr)
|
||||
+@ stdcall D3DXOptimizeVertices(ptr long long long ptr)
|
||||
@ stdcall D3DXPlaneFromPointNormal(ptr ptr ptr)
|
||||
@ stdcall D3DXPlaneFromPoints(ptr ptr ptr ptr)
|
||||
@ stdcall D3DXPlaneIntersectLine(ptr ptr ptr ptr)
|
||||
diff --git a/dlls/d3dx9_43/d3dx9_43.spec b/dlls/d3dx9_43/d3dx9_43.spec
|
||||
index 2f2ac5fd619..7cfc439f84b 100644
|
||||
--- a/dlls/d3dx9_43/d3dx9_43.spec
|
||||
+++ b/dlls/d3dx9_43/d3dx9_43.spec
|
||||
@@ -222,7 +222,7 @@
|
||||
@ stdcall D3DXMatrixTranslation(ptr float float float)
|
||||
@ stdcall D3DXMatrixTranspose(ptr ptr)
|
||||
@ stdcall D3DXOptimizeFaces(ptr long long long ptr)
|
||||
-@ stub D3DXOptimizeVertices(ptr long long long ptr)
|
||||
+@ stdcall D3DXOptimizeVertices(ptr long long long ptr)
|
||||
@ stdcall D3DXPlaneFromPointNormal(ptr ptr ptr)
|
||||
@ stdcall D3DXPlaneFromPoints(ptr ptr ptr ptr)
|
||||
@ stdcall D3DXPlaneIntersectLine(ptr ptr ptr ptr)
|
||||
--
|
||||
2.14.2
|
||||
|
@@ -1 +0,0 @@
|
||||
Fixes: [47776] Timeshift needs D3DXOptimizeVertices()
|
@@ -1,32 +0,0 @@
|
||||
From 5d9d9cbdb4043848aa5ebdd8a1349d9c876650e3 Mon Sep 17 00:00:00 2001
|
||||
From: Christian Costa <titan.costa@gmail.com>
|
||||
Date: Sun, 11 Jan 2015 16:18:03 +0100
|
||||
Subject: [PATCH] d3dx9_36: Add support for FOURCC surface to
|
||||
save_dds_surface_to_memory.
|
||||
|
||||
---
|
||||
dlls/d3dx9_36/surface.c | 8 ++++++++
|
||||
1 file changed, 8 insertions(+)
|
||||
|
||||
diff --git a/dlls/d3dx9_36/surface.c b/dlls/d3dx9_36/surface.c
|
||||
index 26809a47e18..db334ee83f1 100644
|
||||
--- a/dlls/d3dx9_36/surface.c
|
||||
+++ b/dlls/d3dx9_36/surface.c
|
||||
@@ -433,6 +433,14 @@ static HRESULT d3dformat_to_dds_pixel_format(struct dds_pixel_format *pixel_form
|
||||
}
|
||||
}
|
||||
|
||||
+ /* Reuse dds_fourcc_to_d3dformat as D3DFORMAT and FOURCC are DWORD with same values */
|
||||
+ if (dds_fourcc_to_d3dformat(d3dformat) != D3DFMT_UNKNOWN)
|
||||
+ {
|
||||
+ pixel_format->flags |= DDS_PF_FOURCC;
|
||||
+ pixel_format->fourcc = d3dformat;
|
||||
+ return D3D_OK;
|
||||
+ }
|
||||
+
|
||||
WARN("Unknown pixel format %#x.\n", d3dformat);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
--
|
||||
2.35.1
|
||||
|
@@ -1,118 +0,0 @@
|
||||
From 96af775034dae1c0b133b315c45b7172090d3498 Mon Sep 17 00:00:00 2001
|
||||
From: Christian Costa <titan.costa@gmail.com>
|
||||
Date: Sun, 11 Jan 2015 16:29:30 +0100
|
||||
Subject: [PATCH] d3dx9_36: Improve D3DXSaveTextureToFile to save simple
|
||||
texture to dds file.
|
||||
|
||||
---
|
||||
dlls/d3dx9_36/d3dx9_private.h | 2 ++
|
||||
dlls/d3dx9_36/surface.c | 63 +++++++++++++++++++++++++++++++++++
|
||||
dlls/d3dx9_36/texture.c | 5 +--
|
||||
3 files changed, 66 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/dlls/d3dx9_36/d3dx9_private.h b/dlls/d3dx9_36/d3dx9_private.h
|
||||
index 34a9f6eec7f..878dff3fc01 100644
|
||||
--- a/dlls/d3dx9_36/d3dx9_private.h
|
||||
+++ b/dlls/d3dx9_36/d3dx9_private.h
|
||||
@@ -178,6 +178,8 @@ HRESULT lock_surface(IDirect3DSurface9 *surface, const RECT *surface_rect, D3DLO
|
||||
IDirect3DSurface9 **temp_surface, BOOL write);
|
||||
HRESULT unlock_surface(IDirect3DSurface9 *surface, const RECT *surface_rect,
|
||||
IDirect3DSurface9 *temp_surface, BOOL update);
|
||||
+HRESULT save_dds_texture_to_memory(ID3DXBuffer **dst_buffer, IDirect3DBaseTexture9 *src_texture,
|
||||
+ const PALETTEENTRY *src_palette);
|
||||
HRESULT d3dx_pixels_init(const void *data, uint32_t row_pitch, uint32_t slice_pitch,
|
||||
const PALETTEENTRY *palette, D3DFORMAT format, uint32_t left, uint32_t top, uint32_t right, uint32_t bottom,
|
||||
uint32_t front, uint32_t back, struct d3dx_pixels *pixels);
|
||||
diff --git a/dlls/d3dx9_36/surface.c b/dlls/d3dx9_36/surface.c
|
||||
index 31bce97bbab..212d452c654 100644
|
||||
--- a/dlls/d3dx9_36/surface.c
|
||||
+++ b/dlls/d3dx9_36/surface.c
|
||||
@@ -574,6 +574,69 @@ static HRESULT save_dds_surface_to_memory(ID3DXBuffer **dst_buffer, IDirect3DSur
|
||||
return D3D_OK;
|
||||
}
|
||||
|
||||
+static HRESULT get_surface(D3DRESOURCETYPE type, struct IDirect3DBaseTexture9 *tex,
|
||||
+ int face, UINT level, struct IDirect3DSurface9 **surf)
|
||||
+{
|
||||
+ switch (type)
|
||||
+ {
|
||||
+ case D3DRTYPE_TEXTURE:
|
||||
+ return IDirect3DTexture9_GetSurfaceLevel((IDirect3DTexture9*) tex, level, surf);
|
||||
+ case D3DRTYPE_CUBETEXTURE:
|
||||
+ return IDirect3DCubeTexture9_GetCubeMapSurface((IDirect3DCubeTexture9*) tex, face, level, surf);
|
||||
+ default:
|
||||
+ ERR("Unexpected texture type\n");
|
||||
+ return E_NOTIMPL;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+HRESULT save_dds_texture_to_memory(ID3DXBuffer **dst_buffer, IDirect3DBaseTexture9 *src_texture, const PALETTEENTRY *src_palette)
|
||||
+{
|
||||
+ HRESULT hr;
|
||||
+ D3DRESOURCETYPE type;
|
||||
+ UINT mip_levels;
|
||||
+ IDirect3DSurface9 *surface;
|
||||
+
|
||||
+ type = IDirect3DBaseTexture9_GetType(src_texture);
|
||||
+
|
||||
+ if ((type != D3DRTYPE_TEXTURE) && (type != D3DRTYPE_CUBETEXTURE) && (type != D3DRTYPE_VOLUMETEXTURE))
|
||||
+ return D3DERR_INVALIDCALL;
|
||||
+
|
||||
+ if (type == D3DRTYPE_CUBETEXTURE)
|
||||
+ {
|
||||
+ FIXME("Cube texture not supported yet\n");
|
||||
+ return E_NOTIMPL;
|
||||
+ }
|
||||
+ else if (type == D3DRTYPE_VOLUMETEXTURE)
|
||||
+ {
|
||||
+ FIXME("Volume texture not supported yet\n");
|
||||
+ return E_NOTIMPL;
|
||||
+ }
|
||||
+
|
||||
+ mip_levels = IDirect3DTexture9_GetLevelCount(src_texture);
|
||||
+
|
||||
+ if (mip_levels > 1)
|
||||
+ {
|
||||
+ FIXME("Mipmap not supported yet\n");
|
||||
+ return E_NOTIMPL;
|
||||
+ }
|
||||
+
|
||||
+ if (src_palette)
|
||||
+ {
|
||||
+ FIXME("Saving surfaces with palettized pixel formats not implemented yet\n");
|
||||
+ return E_NOTIMPL;
|
||||
+ }
|
||||
+
|
||||
+ hr = get_surface(type, src_texture, D3DCUBEMAP_FACE_POSITIVE_X, 0, &surface);
|
||||
+
|
||||
+ if (SUCCEEDED(hr))
|
||||
+ {
|
||||
+ hr = save_dds_surface_to_memory(dst_buffer, surface, NULL);
|
||||
+ IDirect3DSurface9_Release(surface);
|
||||
+ }
|
||||
+
|
||||
+ return hr;
|
||||
+}
|
||||
+
|
||||
HRESULT load_cube_texture_from_dds(IDirect3DCubeTexture9 *cube_texture, const void *src_data,
|
||||
const PALETTEENTRY *palette, DWORD filter, DWORD color_key, const D3DXIMAGE_INFO *src_info)
|
||||
{
|
||||
diff --git a/dlls/d3dx9_36/texture.c b/dlls/d3dx9_36/texture.c
|
||||
index b42c9db3f2d..d84bac25cfe 100644
|
||||
--- a/dlls/d3dx9_36/texture.c
|
||||
+++ b/dlls/d3dx9_36/texture.c
|
||||
@@ -1847,10 +1847,7 @@ HRESULT WINAPI D3DXSaveTextureToFileInMemory(ID3DXBuffer **dst_buffer, D3DXIMAGE
|
||||
if (!dst_buffer || !src_texture) return D3DERR_INVALIDCALL;
|
||||
|
||||
if (file_format == D3DXIFF_DDS)
|
||||
- {
|
||||
- FIXME("DDS file format isn't supported yet\n");
|
||||
- return E_NOTIMPL;
|
||||
- }
|
||||
+ return save_dds_texture_to_memory(dst_buffer, src_texture, src_palette);
|
||||
|
||||
type = IDirect3DBaseTexture9_GetType(src_texture);
|
||||
switch (type)
|
||||
--
|
||||
2.45.2
|
||||
|
@@ -1,2 +0,0 @@
|
||||
Fixes: [26898] Support for DDS file format in D3DXSaveTextureToFileInMemory
|
||||
Disabled: True
|
@@ -1,87 +0,0 @@
|
||||
From d258e0c4428f3d5b7c0b6f4b31058d8710244dd7 Mon Sep 17 00:00:00 2001
|
||||
From: Christian Costa <titan.costa@gmail.com>
|
||||
Date: Wed, 14 Aug 2013 09:31:31 +0200
|
||||
Subject: d3dx9_36: Filter out D3DCompile warning messages that are not present
|
||||
with D3DCompileShader. (try 4)
|
||||
|
||||
This patch fixes vertex processing issue of bug 33770.
|
||||
|
||||
The problem comes from the fact that even if the call succeeds,
|
||||
the game interprets a non null error_messages pointer as an error.
|
||||
|
||||
By calling D3DCompile we use a newer version of the compiler which is more
|
||||
strict and generates the following warning.
|
||||
- warning X3206: 'dot': implicit truncation of vector type
|
||||
- warning X3206: implicit truncation of vector type
|
||||
- warning X3206: 'mul': implicit truncation of vector type
|
||||
D3DCompileShader does not generate such warnings.
|
||||
|
||||
These is confirmed in the DX SDK release note:
|
||||
New Warning X3206: Implicit Truncation of Vector Type
|
||||
Beginning in the August 2009 release of the DirectX SDK, the compiler will warn
|
||||
when an implicit truncation of a vector type occurs.
|
||||
|
||||
The warnings cannot be disable so this patch filters out these strings in D3DCompileShader
|
||||
and reset the error messages pointer if the resulting buffer is empty.
|
||||
|
||||
Try 2:
|
||||
- only filter out lines containing "X3206:" in case d3dcompiler_43 has localization
|
||||
|
||||
Try 3:
|
||||
- use move in place instead of copying the buffer
|
||||
|
||||
Try 4:
|
||||
- filter simplification by Sebastian and remove 'mul' testing left-out in search string
|
||||
---
|
||||
dlls/d3dx9_36/shader.c | 35 +++++++++++++++++++++++++++++++++++
|
||||
1 file changed, 35 insertions(+)
|
||||
|
||||
diff --git a/dlls/d3dx9_36/shader.c b/dlls/d3dx9_36/shader.c
|
||||
index 5ea3d13..646d3dc 100644
|
||||
--- a/dlls/d3dx9_36/shader.c
|
||||
+++ b/dlls/d3dx9_36/shader.c
|
||||
@@ -450,6 +450,41 @@ HRESULT WINAPI D3DXCompileShader(const char *data, UINT length, const D3DXMACRO
|
||||
}
|
||||
}
|
||||
|
||||
+ /* Filter out D3DCompile warning messages that are not present with D3DCompileShader */
|
||||
+ if (SUCCEEDED(hr) && error_msgs && *error_msgs)
|
||||
+ {
|
||||
+ char *messages = ID3DXBuffer_GetBufferPointer(*error_msgs);
|
||||
+ DWORD size = ID3DXBuffer_GetBufferSize(*error_msgs);
|
||||
+
|
||||
+ /* Ensure messages are null terminated for safe processing */
|
||||
+ if (size) messages[size - 1] = 0;
|
||||
+
|
||||
+ while (size > 1)
|
||||
+ {
|
||||
+ char *prev, *next;
|
||||
+
|
||||
+ /* Warning has the form "warning X3206: ... implicit truncation of vector type"
|
||||
+ but we only search for "X3206:" in case d3dcompiler_43 has localization */
|
||||
+ prev = next = strstr(messages, "X3206:");
|
||||
+ if (!prev) break;
|
||||
+
|
||||
+ /* get pointer to beginning and end of current line */
|
||||
+ while (prev > messages && *(prev - 1) != '\n') prev--;
|
||||
+ while (next < messages + size - 1 && *next != '\n') next++;
|
||||
+ if (next < messages + size - 1 && *next == '\n') next++;
|
||||
+
|
||||
+ memmove(prev, next, messages + size - next);
|
||||
+ size -= (next - prev);
|
||||
+ }
|
||||
+
|
||||
+ /* Only return a buffer if the resulting string is not empty as some apps depend on that */
|
||||
+ if (size <= 1)
|
||||
+ {
|
||||
+ ID3DXBuffer_Release(*error_msgs);
|
||||
+ *error_msgs = NULL;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
return hr;
|
||||
}
|
||||
|
||||
--
|
||||
2.1.2
|
||||
|
@@ -1 +0,0 @@
|
||||
Fixes: [33770] D3DCompileShader should filter specific warning messages
|
@@ -1,182 +0,0 @@
|
||||
From ae80ae124a784078a9838a8aca4b3af308d645dd Mon Sep 17 00:00:00 2001
|
||||
From: Patrick Hibbs <hibbsncc1701@gmail.com>
|
||||
Date: Fri, 30 Sep 2022 17:58:15 -0400
|
||||
Subject: [PATCH] d3dx9: Implement d3dx_effect_SetRawValue
|
||||
|
||||
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=46012
|
||||
|
||||
Signed-off-by: Patrick Hibbs <hibbsncc1701@gmail.com>
|
||||
---
|
||||
dlls/d3dx9_36/effect.c | 154 ++++++++++++++++++++++++++++++++++++++++-
|
||||
1 file changed, 152 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/dlls/d3dx9_36/effect.c b/dlls/d3dx9_36/effect.c
|
||||
index ea965ce789b..625af4af36b 100644
|
||||
--- a/dlls/d3dx9_36/effect.c
|
||||
+++ b/dlls/d3dx9_36/effect.c
|
||||
@@ -4445,10 +4445,160 @@ static HRESULT WINAPI d3dx_effect_CloneEffect(ID3DXEffect *iface, IDirect3DDevic
|
||||
static HRESULT WINAPI d3dx_effect_SetRawValue(ID3DXEffect *iface, D3DXHANDLE parameter, const void *data,
|
||||
UINT byte_offset, UINT bytes)
|
||||
{
|
||||
- FIXME("iface %p, parameter %p, data %p, byte_offset %u, bytes %u stub!\n",
|
||||
+ struct d3dx_effect *effect = impl_from_ID3DXEffect(iface);
|
||||
+ struct d3dx_parameter *param = (parameter == INVALID_HANDLE_VALUE) ? NULL : get_valid_parameter(effect, parameter);
|
||||
+ const unsigned int single_size = sizeof(DWORD);
|
||||
+ unsigned int x, index_offset, remaining_byte_offset, remaining_bytes;
|
||||
+ void *raw;
|
||||
+
|
||||
+ TRACE("iface %p, parameter %p, data %p, byte_offset %u, bytes %u.\n",
|
||||
iface, parameter, data, byte_offset, bytes);
|
||||
|
||||
- return E_NOTIMPL;
|
||||
+ /* pendentic */
|
||||
+ index_offset = 0;
|
||||
+ remaining_byte_offset = 0;
|
||||
+
|
||||
+ /* BOOLs and Matries with a single value copy require sanitization of the
|
||||
+ byte_offset.
|
||||
+
|
||||
+ Specificly, matries with a single value copy only allow byte shifts that
|
||||
+ are not multiples of the value (DWORD) size. For multiples, we increment
|
||||
+ the index of the promoted data type, then add any remainder as a byte
|
||||
+ offset.
|
||||
+
|
||||
+ For BOOLs, due to their value sanitization, we only care about the
|
||||
+ index of their promoted data type. Unless it's a non value size matrix.
|
||||
+ In that case we do care about the byte offset.
|
||||
+ */
|
||||
+ if (byte_offset > 0 && (param->type == D3DXPT_BOOL ||
|
||||
+ (param->class == D3DXPC_MATRIX_COLUMNS ||
|
||||
+ param->class == D3DXPC_MATRIX_ROWS)))
|
||||
+ {
|
||||
+ remaining_byte_offset = byte_offset % single_size;
|
||||
+ if (remaining_byte_offset != 0)
|
||||
+ index_offset = byte_offset / single_size;
|
||||
+ else
|
||||
+ index_offset = byte_offset;
|
||||
+ if (param->type != D3DXPT_BOOL || (bytes != single_size &&
|
||||
+ (param->class == D3DXPC_MATRIX_COLUMNS ||
|
||||
+ param->class == D3DXPC_MATRIX_ROWS)))
|
||||
+ {
|
||||
+ index_offset = index_offset * single_size;
|
||||
+ if (param->type != D3DXPT_BOOL)
|
||||
+ index_offset = index_offset * single_size;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ /* If parameter is bad, we are expected to throw C0000005. */
|
||||
+ switch (param->class)
|
||||
+ {
|
||||
+ case D3DXPC_STRUCT:
|
||||
+ break;
|
||||
+ case D3DXPC_OBJECT:
|
||||
+ raw = param_get_data_and_dirtify(effect, param, param->bytes, TRUE);
|
||||
+ if (data && bytes)
|
||||
+ {
|
||||
+ if (((char*)raw)[0] != '\0')
|
||||
+ {
|
||||
+ memset(raw, '\0', param->bytes);
|
||||
+ return S_OK; /* This returns a false success. */
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ return D3DERR_INVALIDCALL;
|
||||
+ }
|
||||
+ }
|
||||
+ break;
|
||||
+ case D3DXPC_SCALAR:
|
||||
+ raw = param_get_data_and_dirtify(effect, param, param->bytes, TRUE);
|
||||
+ if (param->type == D3DXPT_BOOL)
|
||||
+ *(BOOL*)raw = *(BOOL*)data ? TRUE : FALSE;
|
||||
+ else
|
||||
+ memcpy((unsigned char*)raw + byte_offset, data, bytes);
|
||||
+ return S_OK;
|
||||
+ break;
|
||||
+ case D3DXPC_VECTOR:
|
||||
+ raw = (unsigned char*)param_get_data_and_dirtify(effect, param, param->bytes, TRUE);
|
||||
+ if (param->type == D3DXPT_BOOL)
|
||||
+ {
|
||||
+ raw = (unsigned char*)raw + index_offset;
|
||||
+ *(DWORD*)raw = *(DWORD*)data ? TRUE : FALSE;
|
||||
+ memset((unsigned char*)raw + single_size, \
|
||||
+ '\0', param->bytes - index_offset - single_size);
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ raw = (unsigned char*)raw + byte_offset;
|
||||
+ for (x = 0; (x * single_size) + byte_offset < param->bytes && (x * single_size) < bytes; x++)
|
||||
+ {
|
||||
+ memcpy((unsigned char*)raw + (x * single_size), \
|
||||
+ (unsigned char*)data + (x * single_size), \
|
||||
+ single_size);
|
||||
+ }
|
||||
+ }
|
||||
+ return S_OK;
|
||||
+ break;
|
||||
+ case D3DXPC_MATRIX_COLUMNS:
|
||||
+ case D3DXPC_MATRIX_ROWS:
|
||||
+ raw = (unsigned char*)param_get_data_and_dirtify(effect, param, param->bytes, TRUE);
|
||||
+ if (param->type == D3DXPT_BOOL)
|
||||
+ {
|
||||
+ if (bytes == single_size)
|
||||
+ {
|
||||
+ raw = (unsigned char*)raw + index_offset;
|
||||
+ for (x = 0; (x * single_size) < param->bytes - index_offset; x++)
|
||||
+ {
|
||||
+ remaining_bytes = param->bytes - index_offset - \
|
||||
+ (x * single_size) - single_size;
|
||||
+ *(DWORD*)raw = *(DWORD*)data ? TRUE : FALSE;
|
||||
+ memset((unsigned char*)raw + single_size, \
|
||||
+ '\0', (remaining_bytes > (single_size * 4) ? \
|
||||
+ single_size * 4 : remaining_bytes));
|
||||
+ raw = (unsigned char*)raw + (remaining_bytes > (single_size * 4) ? \
|
||||
+ single_size * 4 : remaining_bytes);
|
||||
+ }
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ raw = (unsigned char*)raw + index_offset;
|
||||
+ for (x = 0; (x * single_size) < param->bytes - index_offset; x++)
|
||||
+ {
|
||||
+ ((DWORD*)raw)[x] = ((DWORD*)data)[x] ? TRUE : FALSE;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ if (bytes == single_size)
|
||||
+ {
|
||||
+ raw = (unsigned char*)raw + index_offset + remaining_byte_offset;
|
||||
+ for (x = 0; (x * single_size) + byte_offset < param->bytes && (x * single_size) < bytes; x++)
|
||||
+ {
|
||||
+ memcpy((unsigned char*)raw + (x * single_size), \
|
||||
+ (unsigned char*)data + (x * single_size), \
|
||||
+ single_size);
|
||||
+ }
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ raw = (unsigned char*)raw + byte_offset;
|
||||
+ for (x = 0; byte_offset + (x * single_size) < param->bytes &&
|
||||
+ (x * single_size) < bytes; x++)
|
||||
+ {
|
||||
+ memcpy((unsigned char*)raw + (x * single_size), \
|
||||
+ (unsigned char*)data + (x * single_size), \
|
||||
+ single_size);
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ return S_OK;
|
||||
+ break;
|
||||
+ default:
|
||||
+ FIXME("Unhandled param class %s.\n", debug_d3dxparameter_class(param->class));
|
||||
+ break;
|
||||
+ };
|
||||
+
|
||||
+ return D3DERR_INVALIDCALL;
|
||||
}
|
||||
#endif
|
||||
|
||||
--
|
||||
2.43.0
|
||||
|
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user