winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
February 2009
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
2 participants
965 discussions
Start a n
N
ew thread
Michael Stefaniuc : advapi32: Remove superfluous pointer casts.
by Alexandre Julliard
16 Feb '09
16 Feb '09
Module: wine Branch: master Commit: 6a48bb42177453d80c26bcfdedf261b59552f0b7 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=6a48bb42177453d80c26bcfde…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Mon Feb 16 09:53:37 2009 +0100 advapi32: Remove superfluous pointer casts. --- dlls/advapi32/cred.c | 10 +++++----- dlls/advapi32/crypt.c | 2 +- dlls/advapi32/security.c | 21 ++++++++++----------- dlls/advapi32/service.c | 4 ++-- 4 files changed, 18 insertions(+), 19 deletions(-) diff --git a/dlls/advapi32/cred.c b/dlls/advapi32/cred.c index 9ad4fb1..0fb36e6 100644 --- a/dlls/advapi32/cred.c +++ b/dlls/advapi32/cred.c @@ -74,7 +74,7 @@ static DWORD read_credential_blob(HKEY hkey, const BYTE key_data[KEY_SIZE], struct ustring data; struct ustring key; - ret = RegQueryValueExW(hkey, wszPasswordValue, 0, &type, (LPVOID)credential_blob, + ret = RegQueryValueExW(hkey, wszPasswordValue, 0, &type, credential_blob, credential_blob_size); if (ret != ERROR_SUCCESS) return ret; @@ -460,7 +460,7 @@ static DWORD write_credential_blob(HKEY hkey, LPCWSTR target_name, DWORD type, data.Buffer = encrypted_credential_blob; SystemFunction032(&data, &key); - ret = RegSetValueExW(hkey, wszPasswordValue, 0, REG_BINARY, (LPVOID)encrypted_credential_blob, credential_blob_size); + ret = RegSetValueExW(hkey, wszPasswordValue, 0, REG_BINARY, encrypted_credential_blob, credential_blob_size); HeapFree(GetProcessHeap(), 0, encrypted_credential_blob); return ret; @@ -647,7 +647,7 @@ static DWORD get_cred_mgr_encryption_key(HKEY hkeyMgr, BYTE key_data[KEY_SIZE]) memcpy(key_data, my_key_data, KEY_SIZE); count = KEY_SIZE; - ret = RegQueryValueExW(hkeyMgr, wszEncryptionKeyValue, NULL, &type, (LPVOID)key_data, + ret = RegQueryValueExW(hkeyMgr, wszEncryptionKeyValue, NULL, &type, key_data, &count); if (ret == ERROR_SUCCESS) { @@ -668,14 +668,14 @@ static DWORD get_cred_mgr_encryption_key(HKEY hkeyMgr, BYTE key_data[KEY_SIZE]) *(DWORD *)(key_data + 4) = value; ret = RegSetValueExW(hkeyMgr, wszEncryptionKeyValue, 0, REG_BINARY, - (LPVOID)key_data, KEY_SIZE); + key_data, KEY_SIZE); if (ret == ERROR_ACCESS_DENIED) { ret = open_cred_mgr_key(&hkeyMgr, TRUE); if (ret == ERROR_SUCCESS) { ret = RegSetValueExW(hkeyMgr, wszEncryptionKeyValue, 0, REG_BINARY, - (LPVOID)key_data, KEY_SIZE); + key_data, KEY_SIZE); RegCloseKey(hkeyMgr); } } diff --git a/dlls/advapi32/crypt.c b/dlls/advapi32/crypt.c index 8ef0a5f..cae03d8 100644 --- a/dlls/advapi32/crypt.c +++ b/dlls/advapi32/crypt.c @@ -54,7 +54,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(crypt); static HWND crypt_hWindow; #define CRYPT_Alloc(size) (LocalAlloc(LMEM_ZEROINIT, size)) -#define CRYPT_Free(buffer) (LocalFree((HLOCAL)buffer)) +#define CRYPT_Free(buffer) (LocalFree(buffer)) static inline PWSTR CRYPT_GetProvKeyName(PCWSTR pProvName) { diff --git a/dlls/advapi32/security.c b/dlls/advapi32/security.c index 4153d93..65fa0db 100644 --- a/dlls/advapi32/security.c +++ b/dlls/advapi32/security.c @@ -341,7 +341,7 @@ static const WCHAR SDDL_AUDIT_FAILURE[] = {'F','A',0}; const char * debugstr_sid(PSID sid) { int auth = 0; - SID * psid = (SID *)sid; + SID * psid = sid; if (psid == NULL) return "(null)"; @@ -3172,7 +3172,7 @@ VOID WINAPI BuildTrusteeWithSidA(PTRUSTEEA pTrustee, PSID pSid) pTrustee->MultipleTrusteeOperation = NO_MULTIPLE_TRUSTEE; pTrustee->TrusteeForm = TRUSTEE_IS_SID; pTrustee->TrusteeType = TRUSTEE_IS_UNKNOWN; - pTrustee->ptstrName = (LPSTR) pSid; + pTrustee->ptstrName = pSid; } /****************************************************************************** @@ -3186,7 +3186,7 @@ VOID WINAPI BuildTrusteeWithSidW(PTRUSTEEW pTrustee, PSID pSid) pTrustee->MultipleTrusteeOperation = NO_MULTIPLE_TRUSTEE; pTrustee->TrusteeForm = TRUSTEE_IS_SID; pTrustee->TrusteeType = TRUSTEE_IS_UNKNOWN; - pTrustee->ptstrName = (LPWSTR) pSid; + pTrustee->ptstrName = pSid; } /****************************************************************************** @@ -3955,7 +3955,7 @@ static BOOL ParseStringAclToAcl(LPCWSTR StringAcl, LPDWORD lpdwFlags, StringAcl++; /* Parse ACE account sid */ - if (ParseStringSidToSid(StringAcl, pAce ? (PSID)&pAce->SidStart : NULL, &sidlen)) + if (ParseStringSidToSid(StringAcl, pAce ? &pAce->SidStart : NULL, &sidlen)) { while (*StringAcl && *StringAcl != ')') StringAcl++; @@ -4051,7 +4051,7 @@ static BOOL ParseStringSecurityDescriptorToSecurityDescriptor( { DWORD bytes; - if (!ParseStringSidToSid(tok, (PSID)lpNext, &bytes)) + if (!ParseStringSidToSid(tok, lpNext, &bytes)) goto lend; if (SecurityDescriptor) @@ -4069,7 +4069,7 @@ static BOOL ParseStringSecurityDescriptorToSecurityDescriptor( { DWORD bytes; - if (!ParseStringSidToSid(tok, (PSID)lpNext, &bytes)) + if (!ParseStringSidToSid(tok, lpNext, &bytes)) goto lend; if (SecurityDescriptor) @@ -4203,8 +4203,7 @@ BOOL WINAPI ConvertStringSecurityDescriptorToSecurityDescriptorW( NULL, &cBytes)) goto lend; - psd = *SecurityDescriptor = (SECURITY_DESCRIPTOR*) LocalAlloc( - GMEM_ZEROINIT, cBytes); + psd = *SecurityDescriptor = LocalAlloc(GMEM_ZEROINIT, cBytes); if (!psd) goto lend; psd->Revision = SID_REVISION; @@ -4383,7 +4382,7 @@ static BOOL DumpAce(LPVOID pace, WCHAR **pwptr, ULONG *plen) return FALSE; } - piace = (ACCESS_ALLOWED_ACE *)pace; + piace = pace; DumpString(&openbr, 1, pwptr, plen); switch (piace->Header.AceType) { @@ -4423,7 +4422,7 @@ static BOOL DumpAce(LPVOID pace, WCHAR **pwptr, ULONG *plen) DumpString(&semicolon, 1, pwptr, plen); /* objects not supported */ DumpString(&semicolon, 1, pwptr, plen); - if (!DumpSid((PSID)&piace->SidStart, pwptr, plen)) + if (!DumpSid(&piace->SidStart, pwptr, plen)) return FALSE; DumpString(&closebr, 1, pwptr, plen); return TRUE; @@ -5074,7 +5073,7 @@ DWORD WINAPI GetNamedSecurityInfoW( LPWSTR name, SE_OBJECT_TYPE type, return ERROR_INVALID_SECURITY_DESCR; } - relative = (SECURITY_DESCRIPTOR_RELATIVE *)*descriptor; + relative = *descriptor; relative->Control |= SE_SELF_RELATIVE; buffer = (BYTE *)relative; offset = sizeof(SECURITY_DESCRIPTOR_RELATIVE); diff --git a/dlls/advapi32/service.c b/dlls/advapi32/service.c index e0efa2b..9af7952 100644 --- a/dlls/advapi32/service.c +++ b/dlls/advapi32/service.c @@ -1809,7 +1809,7 @@ BOOL WINAPI ChangeServiceConfig2A( SC_HANDLE hService, DWORD dwInfoLevel, if (dwInfoLevel == SERVICE_CONFIG_DESCRIPTION) { - LPSERVICE_DESCRIPTIONA sd = (LPSERVICE_DESCRIPTIONA) lpInfo; + LPSERVICE_DESCRIPTIONA sd = lpInfo; SERVICE_DESCRIPTIONW sdw; sdw.lpDescription = SERV_dup( sd->lpDescription ); @@ -1820,7 +1820,7 @@ BOOL WINAPI ChangeServiceConfig2A( SC_HANDLE hService, DWORD dwInfoLevel, } else if (dwInfoLevel == SERVICE_CONFIG_FAILURE_ACTIONS) { - LPSERVICE_FAILURE_ACTIONSA fa = (LPSERVICE_FAILURE_ACTIONSA) lpInfo; + LPSERVICE_FAILURE_ACTIONSA fa = lpInfo; SERVICE_FAILURE_ACTIONSW faw; faw.dwResetPeriod = fa->dwResetPeriod;
1
0
0
0
Detlef Riekenberg : spoolss: Implement EnumPorts.
by Alexandre Julliard
16 Feb '09
16 Feb '09
Module: wine Branch: master Commit: d10ca7d9c405a296ced9a7a41bfd325d62d073f7 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=d10ca7d9c405a296ced9a7a41…
Author: Detlef Riekenberg <wine.dev(a)web.de> Date: Mon Feb 16 00:18:11 2009 +0100 spoolss: Implement EnumPorts. --- dlls/spoolss/router.c | 44 ++++++++++++++++++++++++++++++++++++++++++++ dlls/spoolss/spoolss.spec | 2 +- 2 files changed, 45 insertions(+), 1 deletions(-) diff --git a/dlls/spoolss/router.c b/dlls/spoolss/router.c index 8cf02ff..f4e8e96 100644 --- a/dlls/spoolss/router.c +++ b/dlls/spoolss/router.c @@ -355,3 +355,47 @@ BOOL WINAPI EnumMonitorsW(LPWSTR pName, DWORD Level, LPBYTE pMonitors, DWORD cbB return (res == ROUTER_SUCCESS); } + +/****************************************************************** + * EnumPortsW (spoolss.@) + * + * Enumerate available Ports + * + * PARAMS + * pName [I] Servername or NULL (local Computer) + * Level [I] Structure-Level (1 or 2) + * pPorts [O] PTR to Buffer that receives the Result + * cbBuf [I] Size of Buffer at pPorts + * pcbNeeded [O] PTR to DWORD that receives the size in Bytes used / required for pPorts + * pcReturned [O] PTR to DWORD that receives the number of Ports in pPorts + * + * RETURNS + * Success: TRUE + * Failure: FALSE and in pcbNeeded the Bytes required for pPorts, if cbBuf is too small + * + */ +BOOL WINAPI EnumPortsW(LPWSTR pName, DWORD Level, LPBYTE pPorts, DWORD cbBuf, + LPDWORD pcbNeeded, LPDWORD pcReturned) +{ + backend_t * pb; + DWORD res = ROUTER_UNKNOWN; + + TRACE("(%s, %d, %p, %d, %p, %p)\n", debugstr_w(pName), Level, pPorts, cbBuf, + pcbNeeded, pcReturned); + + if (pcbNeeded) *pcbNeeded = 0; + if (pcReturned) *pcReturned = 0; + + pb = backend_first(pName); + if (pb && pb->fpEnumPorts) + res = pb->fpEnumPorts(pName, Level, pPorts, cbBuf, pcbNeeded, pcReturned); + else + { + SetLastError(ERROR_PROC_NOT_FOUND); + } + + TRACE("got %u with %u (%u byte for %u entries)\n", res, GetLastError(), + pcbNeeded ? *pcbNeeded : 0, pcReturned ? *pcReturned : 0); + + return (res == ROUTER_SUCCESS); +} diff --git a/dlls/spoolss/spoolss.spec b/dlls/spoolss/spoolss.spec index 237bab1..2b5fc19 100644 --- a/dlls/spoolss/spoolss.spec +++ b/dlls/spoolss/spoolss.spec @@ -47,7 +47,7 @@ @ stub EnumJobsW @ stdcall EnumMonitorsW(wstr long ptr long ptr ptr) @ stub EnumPerMachineConnectionsW -@ stdcall EnumPortsW(wstr long ptr ptr ptr ptr) winspool.drv.EnumPortsW +@ stdcall EnumPortsW(wstr long ptr long ptr ptr) @ stub EnumPrintProcessorDatatypesW @ stub EnumPrintProcessorsW @ stub EnumPrinterDataExW
1
0
0
0
Detlef Riekenberg : spoolss: Properly initialize the backends.
by Alexandre Julliard
16 Feb '09
16 Feb '09
Module: wine Branch: master Commit: 190ed7fc77add270ee0b3c33f1a9355d5f8126f0 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=190ed7fc77add270ee0b3c33f…
Author: Detlef Riekenberg <wine.dev(a)web.de> Date: Mon Feb 16 00:13:22 2009 +0100 spoolss: Properly initialize the backends. --- dlls/spoolss/router.c | 33 +++++++++++++++++++++++++++------ 1 files changed, 27 insertions(+), 6 deletions(-) diff --git a/dlls/spoolss/router.c b/dlls/spoolss/router.c index c3b9bb8..8cf02ff 100644 --- a/dlls/spoolss/router.c +++ b/dlls/spoolss/router.c @@ -211,6 +211,8 @@ static backend_t * backend_load(LPWSTR dllname, LPWSTR name, LPWSTR regroot) DWORD id; DWORD res; + TRACE("(%s, %s, %s)\n", debugstr_w(dllname), debugstr_w(name), debugstr_w(regroot)); + EnterCriticalSection(&backend_cs); id = used_backends; @@ -263,13 +265,22 @@ static backend_t * backend_load(LPWSTR dllname, LPWSTR name, LPWSTR regroot) */ BOOL backend_load_all(void) { + static BOOL failed = FALSE; backend_t * pb; - pb = backend_load(localsplW, NULL, NULL); + EnterCriticalSection(&backend_cs); + + /* if we failed before, dont try again */ + if (!failed && (used_backends == 0)) { + pb = backend_load(localsplW, NULL, NULL); - /* ToDo: parse the registry and load all other backends */ + /* ToDo: parse the registry and load all other backends */ - return (pb != NULL); + failed = (used_backends == 0); + } + LeaveCriticalSection(&backend_cs); + TRACE("-> %d\n", !failed); + return (!failed); } /****************************************************************************** @@ -284,10 +295,20 @@ BOOL backend_load_all(void) */ static backend_t * backend_first(LPWSTR name) { - /* test for the local system first */ - if(!name || !name[0]) return backend[0]; - FIXME("server %s not supported\n", debugstr_w(name)); + EnterCriticalSection(&backend_cs); + /* Load all backends, when not done yet */ + if (used_backends || backend_load_all()) { + + /* test for the local system first */ + if (!name || !name[0]) { + LeaveCriticalSection(&backend_cs); + return backend[0]; + } + } + + FIXME("server %s not supported in %d backends\n", debugstr_w(name), used_backends); + LeaveCriticalSection(&backend_cs); return NULL; }
1
0
0
0
Rein Klazes : comctl32: Fix for owner draw statusbar.
by Alexandre Julliard
16 Feb '09
16 Feb '09
Module: wine Branch: master Commit: da257e33011badf0a929dee03dd8390d1b439794 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=da257e33011badf0a929dee03…
Author: Rein Klazes <wijn(a)online.nl> Date: Sun Feb 15 14:27:55 2009 +0100 comctl32: Fix for owner draw statusbar. Ownerdraw status bar should update on receiveing a SB_SETTEXT message, even if the 'text' parameter has not changed. Fix with conformance test. --- dlls/comctl32/status.c | 2 - dlls/comctl32/tests/status.c | 50 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+), 2 deletions(-) diff --git a/dlls/comctl32/status.c b/dlls/comctl32/status.c index 35d3bd4..a56c2a0 100644 --- a/dlls/comctl32/status.c +++ b/dlls/comctl32/status.c @@ -759,8 +759,6 @@ STATUSBAR_SetTextT (STATUS_INFO *infoPtr, INT nPart, WORD style, if (style & SBT_OWNERDRAW) { if (!(oldStyle & SBT_OWNERDRAW)) Free (part->text); - else if (part->text == text) - return TRUE; part->text = (LPWSTR)text; } else { LPWSTR ntext; diff --git a/dlls/comctl32/tests/status.c b/dlls/comctl32/tests/status.c index 4fe6249..4ae663f 100644 --- a/dlls/comctl32/tests/status.c +++ b/dlls/comctl32/tests/status.c @@ -42,6 +42,8 @@ static HWND g_hMainWnd; static int g_wmsize_count = 0; static DWORD g_ysize; static DWORD g_dpisize; +static int g_wmdrawitm_ctr; +static WNDPROC g_wndproc_saved; static HWND create_status_control(DWORD style, DWORD exstyle) { @@ -407,6 +409,53 @@ static void test_status_control(void) DestroyWindow(hWndStatus); } +static LRESULT WINAPI ownerdraw_test_wndproc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) +{ + LRESULT ret; + if (msg == WM_DRAWITEM) + g_wmdrawitm_ctr++; + ret = CallWindowProc(g_wndproc_saved, hwnd, msg, wParam, lParam); + return ret; +} + +static void test_status_ownerdraw(void) +{ + HWND hWndStatus; + int r; + const char* statustext = "STATUS TEXT"; + LONG oldstyle; + + /* subclass the main window and make sure it is visible */ + g_wndproc_saved = (WNDPROC) SetWindowLongPtr( g_hMainWnd, GWLP_WNDPROC, + (LONG_PTR)ownerdraw_test_wndproc ); + ok( g_wndproc_saved != 0, "failed to set the WndProc\n"); + SetWindowPos( g_hMainWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOSIZE|SWP_NOMOVE); + oldstyle = GetWindowLong( g_hMainWnd, GWL_STYLE); + SetWindowLong( g_hMainWnd, GWL_STYLE, oldstyle | WS_VISIBLE); + /* create a status child window */ + ok((hWndStatus = CreateWindowA(SUBCLASS_NAME, "", WS_CHILD|WS_VISIBLE, 0, 0, 100, 100, + g_hMainWnd, NULL, NULL, 0)) != NULL, "CreateWindowA failed\n"); + /* set text */ + g_wmdrawitm_ctr = 0; + r = SendMessage(hWndStatus, SB_SETTEXT, 0, (LPARAM)statustext); + ok( r == TRUE, "Sendmessage returned %d, expected 1\n", r); + ok( 0 == g_wmdrawitm_ctr, "got %d drawitem messages expected none\n", g_wmdrawitm_ctr); + /* set same text, with ownerdraw flag */ + g_wmdrawitm_ctr = 0; + r = SendMessage(hWndStatus, SB_SETTEXT, SBT_OWNERDRAW, (LPARAM)statustext); + ok( r == TRUE, "Sendmessage returned %d, expected 1\n", r); + ok( 1 == g_wmdrawitm_ctr, "got %d drawitem messages expected 1\n", g_wmdrawitm_ctr); + /* ;and again */ + g_wmdrawitm_ctr = 0; + r = SendMessage(hWndStatus, SB_SETTEXT, SBT_OWNERDRAW, (LPARAM)statustext); + ok( r == TRUE, "Sendmessage returned %d, expected 1\n", r); + ok( 1 == g_wmdrawitm_ctr, "got %d drawitem messages expected 1\n", g_wmdrawitm_ctr); + /* clean up */ + DestroyWindow(hWndStatus); + SetWindowLong( g_hMainWnd, GWL_STYLE, oldstyle); + SetWindowLongPtr( g_hMainWnd, GWLP_WNDPROC, (LONG_PTR)g_wndproc_saved ); +} + START_TEST(status) { hinst = GetModuleHandleA(NULL); @@ -423,4 +472,5 @@ START_TEST(status) test_status_control(); test_create(); test_height(); + test_status_ownerdraw(); }
1
0
0
0
Rein Klazes : ole32: In PropVariantCopy() fix calculation size of array that contain pointers, not characters.
by Alexandre Julliard
16 Feb '09
16 Feb '09
Module: wine Branch: master Commit: 788add572bbf139411e2fc02ea9e007ee6c22587 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=788add572bbf139411e2fc02e…
Author: Rein Klazes <wijn(a)online.nl> Date: Fri Feb 13 10:58:14 2009 +0100 ole32: In PropVariantCopy() fix calculation size of array that contain pointers, not characters. --- dlls/ole32/ole2.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dlls/ole32/ole2.c b/dlls/ole32/ole2.c index d1e118a..0e8cab3 100644 --- a/dlls/ole32/ole2.c +++ b/dlls/ole32/ole2.c @@ -2896,9 +2896,9 @@ HRESULT WINAPI PropVariantCopy(PROPVARIANT *pvarDest, /* [out] */ case VT_FILETIME: elemSize = sizeof(pvarSrc->u.filetime); break; case VT_CLSID: elemSize = sizeof(*pvarSrc->u.puuid); break; case VT_CF: elemSize = sizeof(*pvarSrc->u.pclipdata); break; - case VT_BSTR: elemSize = sizeof(*pvarSrc->u.bstrVal); break; - case VT_LPSTR: elemSize = sizeof(*pvarSrc->u.pszVal); break; - case VT_LPWSTR: elemSize = sizeof(*pvarSrc->u.pwszVal); break; + case VT_BSTR: elemSize = sizeof(pvarSrc->u.bstrVal); break; + case VT_LPSTR: elemSize = sizeof(pvarSrc->u.pszVal); break; + case VT_LPWSTR: elemSize = sizeof(pvarSrc->u.pwszVal); break; case VT_VARIANT: elemSize = sizeof(*pvarSrc->u.pvarVal); break; default:
1
0
0
0
David Adam : d3dx8: Implement the spherical interpolation part for D3DXQuaternionSlerp.
by Alexandre Julliard
16 Feb '09
16 Feb '09
Module: wine Branch: master Commit: 2347862571f20e13278649a6bd8fc49ce3b2a448 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=2347862571f20e13278649a6b…
Author: David Adam <david.adam.cnrs(a)gmail.com> Date: Sat Feb 14 14:56:27 2009 +0100 d3dx8: Implement the spherical interpolation part for D3DXQuaternionSlerp. --- dlls/d3dx8/math.c | 24 ++++++++++++++++++------ dlls/d3dx8/tests/math.c | 9 +++++++-- 2 files changed, 25 insertions(+), 8 deletions(-) diff --git a/dlls/d3dx8/math.c b/dlls/d3dx8/math.c index 54f5afb..34f6fed 100644 --- a/dlls/d3dx8/math.c +++ b/dlls/d3dx8/math.c @@ -1173,15 +1173,27 @@ D3DXQUATERNION* WINAPI D3DXQuaternionRotationYawPitchRoll(D3DXQUATERNION *pout, D3DXQUATERNION* WINAPI D3DXQuaternionSlerp(D3DXQUATERNION *pout, CONST D3DXQUATERNION *pq1, CONST D3DXQUATERNION *pq2, FLOAT t) { - FLOAT dot, epsilon; + FLOAT dot, epsilon, temp, theta, u; epsilon = 1.0f; + temp = 1.0f - t; + u = t; dot = D3DXQuaternionDot(pq1, pq2); - if ( dot < 0.0f) epsilon = -1.0f; - pout->x = (1.0f - t) * pq1->x + epsilon * t * pq2->x; - pout->y = (1.0f - t) * pq1->y + epsilon * t * pq2->y; - pout->z = (1.0f - t) * pq1->z + epsilon * t * pq2->z; - pout->w = (1.0f - t) * pq1->w + epsilon * t * pq2->w; + if ( dot < 0.0f ) + { + epsilon = -1.0f; + dot = -dot; + } + if( 1.0f - dot > 0.001f ) + { + theta = acos(dot); + temp = sin(theta * temp) / sin(theta); + u = sin(theta * u) / sin(theta); + } + pout->x = temp * pq1->x + epsilon * u * pq2->x; + pout->y = temp * pq1->y + epsilon * u * pq2->y; + pout->z = temp * pq1->z + epsilon * u * pq2->z; + pout->w = temp * pq1->w + epsilon * u * pq2->w; return pout; } diff --git a/dlls/d3dx8/tests/math.c b/dlls/d3dx8/tests/math.c index 6a7f99d..ec05fad 100644 --- a/dlls/d3dx8/tests/math.c +++ b/dlls/d3dx8/tests/math.c @@ -582,7 +582,7 @@ static void D3DXPlaneTest(void) static void D3X8QuaternionTest(void) { D3DXMATRIX mat; - D3DXQUATERNION expectedquat, gotquat, Nq, Nq1, nul, q, r, s, t, u; + D3DXQUATERNION expectedquat, gotquat, Nq, Nq1, nul, smallq, smallr, q, r, s, t, u; LPD3DXQUATERNION funcpointer; D3DXVECTOR3 axis, expectedvec; FLOAT angle, expected, got, scale, scale2; @@ -591,8 +591,10 @@ static void D3X8QuaternionTest(void) nul.x = 0.0f; nul.y = 0.0f; nul.z = 0.0f; nul.w = 0.0f; q.x = 1.0f, q.y = 2.0f; q.z = 4.0f; q.w = 10.0f; r.x = -3.0f; r.y = 4.0f; r.z = -5.0f; r.w = 7.0; - t.x = -1111.0f, t.y= 111.0f; t.z = -11.0f; t.w = 1.0f; + t.x = -1111.0f, t.y = 111.0f; t.z = -11.0f; t.w = 1.0f; u.x = 91.0f; u.y = - 82.0f; u.z = 7.3f; u.w = -6.4f; + smallq.x = 0.1f; smallq.y = 0.2f; smallq.z= 0.3f; smallq.w = 0.4f; + smallr.x = 0.5f; smallr.y = 0.6f; smallr.z= 0.7f; smallq.w = 0.8f; scale = 0.3f; scale2 = 0.78f; @@ -873,6 +875,9 @@ static void D3X8QuaternionTest(void) expectedquat.x = 334.0f; expectedquat.y = -31.9f; expectedquat.z = 6.1f; expectedquat.w = 6.7f; D3DXQuaternionSlerp(&gotquat,&q,&t,scale); expect_vec4(expectedquat,gotquat); + expectedquat.x = 0.267071f; expectedquat.y = 0.384114f; expectedquat.z = 0.501157f; expectedquat.w = 0.636291f; + D3DXQuaternionSlerp(&gotquat,&smallq,&smallr,scale); + expect_vec4(expectedquat,gotquat); /*_______________D3DXQuaternionSquad________________________*/ expectedquat.x = -156.296f; expectedquat.y = 30.242f; expectedquat.z = -2.5022f; expectedquat.w = 7.3576f;
1
0
0
0
David Adam : d3drm: Simplify some functions.
by Alexandre Julliard
16 Feb '09
16 Feb '09
Module: wine Branch: master Commit: 687ce93882529670468fa7b20ebf411ea7985e29 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=687ce93882529670468fa7b20…
Author: David Adam <david.adam.cnrs(a)gmail.com> Date: Sat Feb 14 14:45:35 2009 +0100 d3drm: Simplify some functions. --- dlls/d3drm/math.c | 29 +++++++++++++++-------------- 1 files changed, 15 insertions(+), 14 deletions(-) diff --git a/dlls/d3drm/math.c b/dlls/d3drm/math.c index 2410715..d3156fc 100644 --- a/dlls/d3drm/math.c +++ b/dlls/d3drm/math.c @@ -128,7 +128,7 @@ LPD3DRMQUATERNION WINAPI D3DRMQuaternionFromRotation(LPD3DRMQUATERNION q, LPD3DV LPD3DRMQUATERNION WINAPI D3DRMQuaternionSlerp(LPD3DRMQUATERNION q, LPD3DRMQUATERNION a, LPD3DRMQUATERNION b, D3DVALUE alpha) { D3DVALUE dot, epsilon, temp, theta, u; - D3DVECTOR sca1,sca2; + dot = a->s * b->s + D3DRMVectorDotProduct(&a->v, &b->v); epsilon = 1.0f; temp = 1.0f - alpha; @@ -145,8 +145,8 @@ LPD3DRMQUATERNION WINAPI D3DRMQuaternionSlerp(LPD3DRMQUATERNION q, LPD3DRMQUATER u = sin(theta * alpha) / sin(theta); } q->s = temp * a->s + epsilon * u * b->s; - D3DRMVectorAdd(&q->v, D3DRMVectorScale(&sca1, &a->v, temp), - D3DRMVectorScale(&sca2, &b->v, epsilon * u)); + D3DRMVectorAdd(&q->v, D3DRMVectorScale(&a->v, &a->v, temp), + D3DRMVectorScale(&b->v, &b->v, epsilon * u)); return q; } @@ -245,19 +245,20 @@ LPD3DVECTOR WINAPI D3DRMVectorReflect(LPD3DVECTOR r, LPD3DVECTOR ray, LPD3DVECTO /* Rotation of a vector */ LPD3DVECTOR WINAPI D3DRMVectorRotate(LPD3DVECTOR r, LPD3DVECTOR v, LPD3DVECTOR axis, D3DVALUE theta) { - D3DRMQUATERNION quaternion,quaternion1, quaternion2, quaternion3, resultq; - D3DVECTOR NORM; - - quaternion1.s = cos(theta*.5); - quaternion2.s = cos(theta*.5); - NORM = *D3DRMVectorNormalize(axis); - D3DRMVectorScale(&quaternion1.v, &NORM, sin(theta * .5)); - D3DRMVectorScale(&quaternion2.v, &NORM, -sin(theta * .5)); + D3DRMQUATERNION quaternion1, quaternion2, quaternion3; + D3DVECTOR norm; + + quaternion1.s = cos(theta * 0.5f); + quaternion2.s = cos(theta * 0.5f); + norm = *D3DRMVectorNormalize(axis); + D3DRMVectorScale(&quaternion1.v, &norm, sin(theta * 0.5f)); + D3DRMVectorScale(&quaternion2.v, &norm, -sin(theta * 0.5f)); quaternion3.s = 0.0; quaternion3.v = *v; - D3DRMQuaternionMultiply(&quaternion, &quaternion1, &quaternion3); - D3DRMQuaternionMultiply(&resultq, &quaternion, &quaternion2); - *r = *D3DRMVectorNormalize(&resultq.v); + D3DRMQuaternionMultiply(&quaternion1, &quaternion1, &quaternion3); + D3DRMQuaternionMultiply(&quaternion1, &quaternion1, &quaternion2); + + *r = *D3DRMVectorNormalize(&quaternion1.v); return r; }
1
0
0
0
David Adam : d3drm: Allow output pointer to be equal to input pointer.
by Alexandre Julliard
16 Feb '09
16 Feb '09
Module: wine Branch: master Commit: f877cb9a8945718eb0c43c7daa53f437a498e1a1 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f877cb9a8945718eb0c43c7da…
Author: David Adam <david.adam.cnrs(a)gmail.com> Date: Sat Feb 14 14:35:42 2009 +0100 d3drm: Allow output pointer to be equal to input pointer. --- dlls/d3drm/math.c | 58 +++++++++++++++++++++++++++++++-------------- dlls/d3drm/tests/vector.c | 28 +++++++++++++++++++++- 2 files changed, 67 insertions(+), 19 deletions(-) diff --git a/dlls/d3drm/math.c b/dlls/d3drm/math.c index 8bf5035..2410715 100644 --- a/dlls/d3drm/math.c +++ b/dlls/d3drm/math.c @@ -77,12 +77,16 @@ D3DVALUE WINAPI D3DRMColorGetRed(D3DCOLOR color) /* Product of 2 quaternions */ LPD3DRMQUATERNION WINAPI D3DRMQuaternionMultiply(LPD3DRMQUATERNION q, LPD3DRMQUATERNION a, LPD3DRMQUATERNION b) { + D3DRMQUATERNION temp; D3DVECTOR cross_product; + D3DRMVectorCrossProduct(&cross_product, &a->v, &b->v); - q->s = a->s * b->s - D3DRMVectorDotProduct(&a->v, &b->v); - q->v.u1.x = a->s * b->v.u1.x + b->s * a->v.u1.x + cross_product.u1.x; - q->v.u2.y = a->s * b->v.u2.y + b->s * a->v.u2.y + cross_product.u2.y; - q->v.u3.z = a->s * b->v.u3.z + b->s * a->v.u3.z + cross_product.u3.z; + temp.s = a->s * b->s - D3DRMVectorDotProduct(&a->v, &b->v); + temp.v.u1.x = a->s * b->v.u1.x + b->s * a->v.u1.x + cross_product.u1.x; + temp.v.u2.y = a->s * b->v.u2.y + b->s * a->v.u2.y + cross_product.u2.y; + temp.v.u3.z = a->s * b->v.u3.z + b->s * a->v.u3.z + cross_product.u3.z; + + *q = temp; return q; } @@ -149,27 +153,39 @@ LPD3DRMQUATERNION WINAPI D3DRMQuaternionSlerp(LPD3DRMQUATERNION q, LPD3DRMQUATER /* Add Two Vectors */ LPD3DVECTOR WINAPI D3DRMVectorAdd(LPD3DVECTOR d, LPD3DVECTOR s1, LPD3DVECTOR s2) { - d->u1.x=s1->u1.x + s2->u1.x; - d->u2.y=s1->u2.y + s2->u2.y; - d->u3.z=s1->u3.z + s2->u3.z; + D3DVECTOR temp; + + temp.u1.x=s1->u1.x + s2->u1.x; + temp.u2.y=s1->u2.y + s2->u2.y; + temp.u3.z=s1->u3.z + s2->u3.z; + + *d = temp; return d; } /* Subtract Two Vectors */ LPD3DVECTOR WINAPI D3DRMVectorSubtract(LPD3DVECTOR d, LPD3DVECTOR s1, LPD3DVECTOR s2) { - d->u1.x=s1->u1.x - s2->u1.x; - d->u2.y=s1->u2.y - s2->u2.y; - d->u3.z=s1->u3.z - s2->u3.z; + D3DVECTOR temp; + + temp.u1.x=s1->u1.x - s2->u1.x; + temp.u2.y=s1->u2.y - s2->u2.y; + temp.u3.z=s1->u3.z - s2->u3.z; + + *d = temp; return d; } /* Cross Product of Two Vectors */ LPD3DVECTOR WINAPI D3DRMVectorCrossProduct(LPD3DVECTOR d, LPD3DVECTOR s1, LPD3DVECTOR s2) { - d->u1.x=s1->u2.y * s2->u3.z - s1->u3.z * s2->u2.y; - d->u2.y=s1->u3.z * s2->u1.x - s1->u1.x * s2->u3.z; - d->u3.z=s1->u1.x * s2->u2.y - s1->u2.y * s2->u1.x; + D3DVECTOR temp; + + temp.u1.x=s1->u2.y * s2->u3.z - s1->u3.z * s2->u2.y; + temp.u2.y=s1->u3.z * s2->u1.x - s1->u1.x * s2->u3.z; + temp.u3.z=s1->u1.x * s2->u2.y - s1->u2.y * s2->u1.x; + + *d = temp; return d; } @@ -219,8 +235,10 @@ LPD3DVECTOR WINAPI D3DRMVectorRandom(LPD3DVECTOR d) /* Reflection of a vector on a surface */ LPD3DVECTOR WINAPI D3DRMVectorReflect(LPD3DVECTOR r, LPD3DVECTOR ray, LPD3DVECTOR norm) { - D3DVECTOR sca; - D3DRMVectorSubtract(r, D3DRMVectorScale(&sca, norm, 2.0*D3DRMVectorDotProduct(ray,norm)), ray); + D3DVECTOR sca, temp; + D3DRMVectorSubtract(&temp, D3DRMVectorScale(&sca, norm, 2.0*D3DRMVectorDotProduct(ray,norm)), ray); + + *r = temp; return r; } @@ -246,8 +264,12 @@ LPD3DVECTOR WINAPI D3DRMVectorRotate(LPD3DVECTOR r, LPD3DVECTOR v, LPD3DVECTOR a /* Scale a vector */ LPD3DVECTOR WINAPI D3DRMVectorScale(LPD3DVECTOR d, LPD3DVECTOR s, D3DVALUE factor) { - d->u1.x=factor * s->u1.x; - d->u2.y=factor * s->u2.y; - d->u3.z=factor * s->u3.z; + D3DVECTOR temp; + + temp.u1.x=factor * s->u1.x; + temp.u2.y=factor * s->u2.y; + temp.u3.z=factor * s->u3.z; + + *d = temp; return d; } diff --git a/dlls/d3drm/tests/vector.c b/dlls/d3drm/tests/vector.c index 75c05fc..533523f 100644 --- a/dlls/d3drm/tests/vector.c +++ b/dlls/d3drm/tests/vector.c @@ -130,26 +130,42 @@ static BOOL InitFunctionPtrs(void) static void VectorTest(void) { D3DVALUE mod,par,theta; - D3DVECTOR e,r,u,v,w,axis,casnul,norm,ray; + D3DVECTOR e,r,u,v,w,axis,casnul,norm,ray,self; U1(u).x=2.0f; U2(u).y=2.0f; U3(u).z=1.0f; U1(v).x=4.0f; U2(v).y=4.0f; U3(v).z=0.0f; + /*______________________VectorAdd_________________________________*/ pD3DRMVectorAdd(&r,&u,&v); U1(e).x=6.0f; U2(e).y=6.0f; U3(e).z=1.0f; expect_vec(e,r); + U1(self).x=9.0f; U1(self).y=18.0f; U3(self).z=27.0f; + pD3DRMVectorAdd(&self,&self,&u); + U1(e).x=11.0f; U2(e).y=20.0f; U3(e).z=28.0f; + expect_vec(e,self); + /*_______________________VectorSubtract__________________________*/ pD3DRMVectorSubtract(&r,&u,&v); U1(e).x=-2.0f; U2(e).y=-2.0f; U3(e).z=1.0f; expect_vec(e,r); + U1(self).x=9.0f; U1(self).y=18.0f; U3(self).z=27.0f; + pD3DRMVectorSubtract(&self,&self,&u); + U1(e).x=7.0f; U2(e).y=16.0f; U3(e).z=26.0f; + expect_vec(e,self); + /*_______________________VectorCrossProduct_______________________*/ pD3DRMVectorCrossProduct(&r,&u,&v); U1(e).x=-4.0f; U2(e).y=4.0f; U3(e).z=0.0f; expect_vec(e,r); + U1(self).x=9.0f; U1(self).y=18.0f; U3(self).z=27.0f; + pD3DRMVectorCrossProduct(&self,&self,&u); + U1(e).x=-36.0f; U2(e).y=45.0f; U3(e).z=-18.0f; + expect_vec(e,self); + /*_______________________VectorDotProduct__________________________*/ mod=pD3DRMVectorDotProduct(&u,&v); ok((mod == 16.0f), "Expected 16.0f, Got %f\n", mod); @@ -191,11 +207,21 @@ static void VectorTest(void) U1(e).x=1.4f/sqrtf(2.0f); U2(e).y=0.2f/sqrtf(2.0f); U3(e).z=0.0f; expect_vec(e,r); + theta=PI/8.0f; + pD3DRMVectorRotate(&self,&self,&axis,theta); + U1(e).x=0.989950; U2(e).y=0.141421f; U3(e).z=0.0f; + expect_vec(e,r); + /*_______________________VectorScale__________________________*/ par=2.5f; pD3DRMVectorScale(&r,&v,par); U1(e).x=10.0f; U2(e).y=10.0f; U3(e).z=0.0f; expect_vec(e,r); + + U1(self).x=9.0f; U1(self).y=18.0f; U3(self).z=27.0f; + pD3DRMVectorScale(&self,&self,2); + U1(e).x=18.0f; U2(e).y=36.0f; U3(e).z=54.0f; + expect_vec(e,self); } static void MatrixTest(void)
1
0
0
0
David Adam : d3drm: Implement the spherical interpolation part of D3DRMQuaternionSlerp.
by Alexandre Julliard
16 Feb '09
16 Feb '09
Module: wine Branch: master Commit: 44e74969e3753d5517277afa2aa9a798e37e2cdf URL:
http://source.winehq.org/git/wine.git/?a=commit;h=44e74969e3753d5517277afa2…
Author: David Adam <david.adam.cnrs(a)gmail.com> Date: Sat Feb 14 13:56:00 2009 +0100 d3drm: Implement the spherical interpolation part of D3DRMQuaternionSlerp. --- dlls/d3drm/math.c | 24 +++++++++++++++++++----- dlls/d3drm/tests/vector.c | 12 +++++++++--- 2 files changed, 28 insertions(+), 8 deletions(-) diff --git a/dlls/d3drm/math.c b/dlls/d3drm/math.c index 801a1bf..8bf5035 100644 --- a/dlls/d3drm/math.c +++ b/dlls/d3drm/math.c @@ -123,12 +123,26 @@ LPD3DRMQUATERNION WINAPI D3DRMQuaternionFromRotation(LPD3DRMQUATERNION q, LPD3DV /* Interpolation between two quaternions */ LPD3DRMQUATERNION WINAPI D3DRMQuaternionSlerp(LPD3DRMQUATERNION q, LPD3DRMQUATERNION a, LPD3DRMQUATERNION b, D3DVALUE alpha) { - D3DVALUE epsilon=1.0; + D3DVALUE dot, epsilon, temp, theta, u; D3DVECTOR sca1,sca2; - if (a->s * b->s + D3DRMVectorDotProduct(&a->v, &b->v) < 0.0) epsilon = -1.0; - q->s = (1.0 - alpha) * a->s + epsilon * alpha * b->s; - D3DRMVectorAdd(&q->v, D3DRMVectorScale(&sca1, &a->v, 1.0 - alpha), - D3DRMVectorScale(&sca2, &b->v, epsilon * alpha)); + dot = a->s * b->s + D3DRMVectorDotProduct(&a->v, &b->v); + epsilon = 1.0f; + temp = 1.0f - alpha; + u = alpha; + if (dot < 0.0) + { + epsilon = -1.0; + dot = -dot; + } + if( 1.0f - dot > 0.001f ) + { + theta = acos(dot); + temp = sin(theta * temp) / sin(theta); + u = sin(theta * alpha) / sin(theta); + } + q->s = temp * a->s + epsilon * u * b->s; + D3DRMVectorAdd(&q->v, D3DRMVectorScale(&sca1, &a->v, temp), + D3DRMVectorScale(&sca2, &b->v, epsilon * u)); return q; } diff --git a/dlls/d3drm/tests/vector.c b/dlls/d3drm/tests/vector.c index 4b0f97f..75c05fc 100644 --- a/dlls/d3drm/tests/vector.c +++ b/dlls/d3drm/tests/vector.c @@ -227,10 +227,9 @@ static void QuaternionTest(void) expect_quat(q,r); /*_________________QuaternionSlerp_________________________*/ -/* Interpolation slerp is in fact a linear interpolation, not a spherical linear - * interpolation. Moreover, if the angle of the two quaternions is in ]PI/2;3PI/2[, QuaternionSlerp +/* If the angle of the two quaternions is in ]PI/2;3PI/2[, QuaternionSlerp * interpolates between the first quaternion and the opposite of the second one. The test proves - * these two facts. */ + * this fact. */ par=0.31f; q1.s=1.0f; U1(q1.v).x=2.0f; U2(q1.v).y=3.0f; U3(q1.v).z=50.0f; q2.s=-4.0f; U1(q2.v).x=6.0f; U2(q2.v).y=7.0f; U3(q2.v).z=8.0f; @@ -256,6 +255,13 @@ static void QuaternionTest(void) U3(q.v).z=g*U3(q1.v).z+h*U3(q2.v).z; pD3DRMQuaternionSlerp(&r,&q1,&q2,par); expect_quat(q,r); + +/* Test the spherical interpolation part */ + q1.s=0.1f; U1(q1.v).x=0.2f; U2(q1.v).y=0.3f; U3(q1.v).z=0.4f; + q2.s=0.5f; U1(q2.v).x=0.6f; U2(q2.v).y=0.7f; U3(q2.v).z=0.8f; + q.s = 0.243943f; U1(q.v).x = 0.351172f; U2(q.v).y = 0.458401f; U3(q.v).z = 0.565629f; + pD3DRMQuaternionSlerp(&r,&q1,&q2,par); + expect_quat(q,r); } static void ColorTest(void)
1
0
0
0
David Adam : d3drm: Remove unneeded includes.
by Alexandre Julliard
16 Feb '09
16 Feb '09
Module: wine Branch: master Commit: a737dcf03dfa240d21d69547825f1ee0d8fb35df URL:
http://source.winehq.org/git/wine.git/?a=commit;h=a737dcf03dfa240d21d695478…
Author: David Adam <david.adam.cnrs(a)gmail.com> Date: Sat Feb 14 13:18:14 2009 +0100 d3drm: Remove unneeded includes. --- dlls/d3drm/math.c | 6 +----- 1 files changed, 1 insertions(+), 5 deletions(-) diff --git a/dlls/d3drm/math.c b/dlls/d3drm/math.c index ff416b6..801a1bf 100644 --- a/dlls/d3drm/math.c +++ b/dlls/d3drm/math.c @@ -19,12 +19,8 @@ #define NONAMELESSUNION -#include <stdio.h> -#include <stdlib.h> -#include <stdarg.h> -#include <assert.h> #include <math.h> - +#include <stdarg.h> #include "windef.h" #include "winbase.h" #include "wingdi.h"
1
0
0
0
← Newer
1
...
42
43
44
45
46
47
48
...
97
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
Results per page:
10
25
50
100
200