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
May 2011
----- 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
945 discussions
Start a n
N
ew thread
Alexandre Julliard : widl: Don' t call the buffer sizer routine when the size is known already.
by Alexandre Julliard
25 May '11
25 May '11
Module: wine Branch: master Commit: bf9d2904dc2e5d229b34b16cd614b0f2742b593a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=bf9d2904dc2e5d229b34b16cd…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue May 24 22:47:07 2011 +0200 widl: Don't call the buffer sizer routine when the size is known already. --- tools/widl/typegen.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/tools/widl/typegen.c b/tools/widl/typegen.c index 51f531d..324211e 100644 --- a/tools/widl/typegen.c +++ b/tools/widl/typegen.c @@ -3537,7 +3537,7 @@ static void write_remoting_arg(FILE *file, int indent, const var_t *func, const { int in_attr, out_attr, pointer_type; const type_t *type = var->type; - unsigned int start_offset = type->typestring_offset; + unsigned int alignment, start_offset = type->typestring_offset; if (is_ptr(type) || is_array(type)) pointer_type = get_pointer_fc(type, var->attrs, pass != PASS_RETURN); @@ -3562,6 +3562,8 @@ static void write_remoting_arg(FILE *file, int indent, const var_t *func, const break; } + if (phase == PHASE_BUFFERSIZE && get_required_buffer_size( var, &alignment, pass )) return; + write_parameter_conf_or_var_exprs(file, indent, local_var_prefix, phase, var); switch (typegen_detect_type(type, var->attrs, TDT_ALL_TYPES))
1
0
0
0
Alexandre Julliard : widl: Only return a buffer size for fixed-size arrays.
by Alexandre Julliard
25 May '11
25 May '11
Module: wine Branch: master Commit: 050f6f38d5b006e86732026531eba8402b0e93af URL:
http://source.winehq.org/git/wine.git/?a=commit;h=050f6f38d5b006e8673202653…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue May 24 22:30:23 2011 +0200 widl: Only return a buffer size for fixed-size arrays. --- tools/widl/typegen.c | 14 +++++++++++--- 1 files changed, 11 insertions(+), 3 deletions(-) diff --git a/tools/widl/typegen.c b/tools/widl/typegen.c index 2d2bd75..51f531d 100644 --- a/tools/widl/typegen.c +++ b/tools/widl/typegen.c @@ -3214,9 +3214,17 @@ static unsigned int get_required_buffer_size_type( case TGT_ARRAY: if (get_pointer_fc(type, attrs, toplevel_param) == RPC_FC_RP) - return type_array_get_dim(type) * - get_required_buffer_size_type(type_array_get_element(type), name, - NULL, FALSE, alignment); + { + switch (get_array_fc(type)) + { + case RPC_FC_SMFARRAY: + case RPC_FC_LGFARRAY: + return type_array_get_dim(type) * + get_required_buffer_size_type(type_array_get_element(type), name, + NULL, FALSE, alignment); + } + } + break; default: break;
1
0
0
0
Alexandre Julliard : winetest: Use the host platform as id for Wine runs.
by Alexandre Julliard
25 May '11
25 May '11
Module: tools Branch: master Commit: 800bb9592b5ea9e2beb7ff2168ff247bd84001d0 URL:
http://source.winehq.org/git/tools.git/?a=commit;h=800bb9592b5ea9e2beb7ff21…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed May 25 14:23:48 2011 +0200 winetest: Use the host platform as id for Wine runs. --- winetest/dissect | 12 +++++++++--- winetest/gather | 4 ++-- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/winetest/dissect b/winetest/dissect index 03dcfd1..62d0812 100755 --- a/winetest/dissect +++ b/winetest/dissect @@ -124,7 +124,7 @@ while (($_ = <IN>) =~ s/^ //) $box->{data} .= "<div class=\"output\">" . escapeHTML($_) . "</div>\n"; } -my ($wine, $wine_build, $version, $major, $minor, $plid, $product); +my ($wine, $wine_build, $version, $major, $minor, $plid, $product, $host); /^Operating system version:\r?$/ or mydie "no OS header: $_"; $box->{data} .= "<h2>Operating system version</h2>\n"; $box->{data} .= "<table class=\"output\">\n"; @@ -148,6 +148,8 @@ while (($_ = <IN>) =~ /^\s*([0-9a-zA-Z ]+)=(.*?)\r?$/) { $wine_build = $2; } elsif ($1 eq "Platform") { $archive = "winetest64-$shortbuild.exe" if ($2 eq "x86_64"); + } elsif ($1 eq "Host system") { + $host = $2; } } $box->{data} .= "</table>\n"; @@ -196,10 +198,14 @@ if ($plid==1 && $major==4) { } } } elsif ($plid==3) { - $version = "ce$major$minor"; + #$version = "ce$major$minor"; } if ($wine) { - $version = "wine"; + my %known_hosts = ( "Linux" => "linux", + "Darwin" => "mac", + "FreeBSD" => "bsd", + "SunOS" => "solaris" ); + $version = $host && defined($known_hosts{$host}) ? $known_hosts{$host} : "wine"; } if ($wine_build) { my $wine_commit; diff --git a/winetest/gather b/winetest/gather index ab5e41f..3ce627a 100755 --- a/winetest/gather +++ b/winetest/gather @@ -100,8 +100,8 @@ my %wine = (name => "Wine"); # Map dissect's IDs to the above hashes my %idmap = (95=>\%w95, 98=>\%w98, me=>\%me, nt3=>\%nt3, nt4=>\%nt4, 2000=>\%w2k, - xp=>\%xp, 2003=>\%w2k3, vista=>\%vista, 2008=>\%w2k8, win7=>\%win7, - unknown=>\%unknown, wine=>\%wine); + xp=>\%xp, 2003=>\%w2k3, vista=>\%vista, 2008=>\%w2k8, win7=>\%win7, unknown=>\%unknown, + wine=>\%wine, linux=>\%wine, mac=>\%wine, bsd=>\%wine, solaris=>\%wine); # Define the order of version groups in the summary my @groups = (\%w95, \%w98, \%me, \%nt3, \%nt4, \%w2k, \%xp, \%w2k3, \%vista, \%w2k8, \%win7, \%unknown, \%wine);
1
0
0
0
Dylan Smith : d3dx9: Add support for loading mesh normals from X files.
by Alexandre Julliard
24 May '11
24 May '11
Module: wine Branch: master Commit: 6c9cff2e3f9b1e6fac16b2592080e553f9c38009 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=6c9cff2e3f9b1e6fac16b2592…
Author: Dylan Smith <dylan.ah.smith(a)gmail.com> Date: Fri May 20 16:25:10 2011 -0400 d3dx9: Add support for loading mesh normals from X files. --- dlls/d3dx9_36/mesh.c | 180 +++++++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 177 insertions(+), 3 deletions(-) diff --git a/dlls/d3dx9_36/mesh.c b/dlls/d3dx9_36/mesh.c index 69732e3..48ae20e 100644 --- a/dlls/d3dx9_36/mesh.c +++ b/dlls/d3dx9_36/mesh.c @@ -36,6 +36,7 @@ #include "rmxftmpl.h" #include "wine/debug.h" #include "wine/unicode.h" +#include "wine/list.h" #include "d3dx9_36_private.h" WINE_DEFAULT_DEBUG_CHANNEL(d3dx); @@ -1822,6 +1823,12 @@ struct mesh_data { DWORD *indices; DWORD fvf; + + /* optional mesh data */ + + DWORD num_normals; + D3DXVECTOR3 *normals; + DWORD *normal_indices; }; static HRESULT get_next_child(IDirectXFileData *filedata, IDirectXFileData **child, const GUID **type) @@ -1855,6 +1862,95 @@ static HRESULT get_next_child(IDirectXFileData *filedata, IDirectXFileData **chi return hr; } +static HRESULT parse_normals(IDirectXFileData *filedata, struct mesh_data *mesh) +{ + HRESULT hr; + DWORD data_size; + BYTE *data; + DWORD *index_out_ptr; + int i; + DWORD num_face_indices = mesh->num_poly_faces * 2 + mesh->num_tri_faces; + + HeapFree(GetProcessHeap(), 0, mesh->normals); + mesh->num_normals = 0; + mesh->normals = NULL; + mesh->normal_indices = NULL; + mesh->fvf |= D3DFVF_NORMAL; + + hr = IDirectXFileData_GetData(filedata, NULL, &data_size, (void**)&data); + if (FAILED(hr)) return hr; + + /* template Vector { + * FLOAT x; + * FLOAT y; + * FLOAT z; + * } + * template MeshFace { + * DWORD nFaceVertexIndices; + * array DWORD faceVertexIndices[nFaceVertexIndices]; + * } + * template MeshNormals { + * DWORD nNormals; + * array Vector normals[nNormals]; + * DWORD nFaceNormals; + * array MeshFace faceNormals[nFaceNormals]; + * } + */ + + if (data_size < sizeof(DWORD) * 2) + goto truncated_data_error; + mesh->num_normals = *(DWORD*)data; + data += sizeof(DWORD); + if (data_size < sizeof(DWORD) * 2 + mesh->num_normals * sizeof(D3DXVECTOR3) + + num_face_indices * sizeof(DWORD)) + goto truncated_data_error; + + mesh->normals = HeapAlloc(GetProcessHeap(), 0, mesh->num_normals * sizeof(D3DXVECTOR3)); + mesh->normal_indices = HeapAlloc(GetProcessHeap(), 0, num_face_indices * sizeof(DWORD)); + if (!mesh->normals || !mesh->normal_indices) + return E_OUTOFMEMORY; + + memcpy(mesh->normals, data, mesh->num_normals * sizeof(D3DXVECTOR3)); + data += mesh->num_normals * sizeof(D3DXVECTOR3); + for (i = 0; i < mesh->num_normals; i++) + D3DXVec3Normalize(&mesh->normals[i], &mesh->normals[i]); + + if (*(DWORD*)data != mesh->num_poly_faces) { + WARN("number of face normals (%u) doesn't match number of faces (%u)\n", + *(DWORD*)data, mesh->num_poly_faces); + return E_FAIL; + } + data += sizeof(DWORD); + index_out_ptr = mesh->normal_indices; + for (i = 0; i < mesh->num_poly_faces; i++) + { + DWORD j; + DWORD count = *(DWORD*)data; + if (count != mesh->num_tri_per_face[i] + 2) { + WARN("face %u: number of normals (%u) doesn't match number of vertices (%u)\n", + i, count, mesh->num_tri_per_face[i] + 2); + return E_FAIL; + } + data += sizeof(DWORD); + + for (j = 0; j < count; j++) { + DWORD normal_index = *(DWORD*)data; + if (normal_index >= mesh->num_normals) { + WARN("face %u, normal index %u: reference to undefined normal %u (only %u normals)\n", + i, j, normal_index, mesh->num_normals); + return E_FAIL; + } + *index_out_ptr++ = normal_index; + data += sizeof(DWORD); + } + } + + return D3D_OK; +truncated_data_error: + WARN("truncated data (%u bytes)\n", data_size); + return E_FAIL; +} + /* for provide_flags parameters */ #define PROVIDE_MATERIALS 0x1 #define PROVIDE_SKININFO 0x2 @@ -1953,8 +2049,7 @@ static HRESULT parse_mesh(IDirectXFileData *filedata, struct mesh_data *mesh_dat while (SUCCEEDED(hr = get_next_child(filedata, &child, &type))) { if (IsEqualGUID(type, &TID_D3DRMMeshNormals)) { - FIXME("Mesh normal loading not implemented.\n"); - hr = E_NOTIMPL; + hr = parse_normals(child, mesh_data); } else if (IsEqualGUID(type, &TID_D3DRMMeshVertexColors)) { FIXME("Mesh vertex color loading not implemented.\n"); hr = E_NOTIMPL; @@ -1997,8 +2092,13 @@ static HRESULT load_skin_mesh_from_xof(IDirectXFileData *filedata, HRESULT hr; DWORD *index_in_ptr; struct mesh_data mesh_data; + DWORD total_vertices; ID3DXMesh *d3dxmesh = NULL; ID3DXBuffer *adjacency = NULL; + struct vertex_duplication { + DWORD normal_index; + struct list entry; + } *duplications = NULL; int i; void *vertices = NULL; void *indices = NULL; @@ -2015,7 +2115,54 @@ static HRESULT load_skin_mesh_from_xof(IDirectXFileData *filedata, hr = parse_mesh(filedata, &mesh_data, provide_flags); if (FAILED(hr)) goto cleanup; - hr = D3DXCreateMeshFVF(mesh_data.num_tri_faces, mesh_data.num_vertices, D3DXMESH_MANAGED, mesh_data.fvf, device, &d3dxmesh); + total_vertices = mesh_data.num_vertices; + if (mesh_data.fvf & D3DFVF_NORMAL) { + /* duplicate vertices with multiple normals */ + DWORD num_face_indices = mesh_data.num_poly_faces * 2 + mesh_data.num_tri_faces; + duplications = HeapAlloc(GetProcessHeap(), 0, (mesh_data.num_vertices + num_face_indices) * sizeof(*duplications)); + if (!duplications) { + hr = E_OUTOFMEMORY; + goto cleanup; + } + for (i = 0; i < total_vertices; i++) + { + duplications[i].normal_index = -1; + list_init(&duplications[i].entry); + } + for (i = 0; i < num_face_indices; i++) { + DWORD vertex_index = mesh_data.indices[i]; + DWORD normal_index = mesh_data.normal_indices[i]; + struct vertex_duplication *dup_ptr = &duplications[vertex_index]; + + if (dup_ptr->normal_index == -1) { + dup_ptr->normal_index = normal_index; + } else { + D3DXVECTOR3 *new_normal = &mesh_data.normals[normal_index]; + struct list *dup_list = &dup_ptr->entry; + while (TRUE) { + D3DXVECTOR3 *cur_normal = &mesh_data.normals[dup_ptr->normal_index]; + if (new_normal->x == cur_normal->x && + new_normal->y == cur_normal->y && + new_normal->z == cur_normal->z) + { + mesh_data.indices[i] = dup_ptr - duplications; + break; + } else if (!list_next(dup_list, &dup_ptr->entry)) { + dup_ptr = &duplications[total_vertices++]; + dup_ptr->normal_index = normal_index; + list_add_tail(dup_list, &dup_ptr->entry); + mesh_data.indices[i] = dup_ptr - duplications; + break; + } else { + dup_ptr = LIST_ENTRY(list_next(dup_list, &dup_ptr->entry), + struct vertex_duplication, entry); + } + } + } + } + } + + hr = D3DXCreateMeshFVF(mesh_data.num_tri_faces, total_vertices, D3DXMESH_MANAGED, mesh_data.fvf, device, &d3dxmesh); if (FAILED(hr)) goto cleanup; hr = d3dxmesh->lpVtbl->LockVertexBuffer(d3dxmesh, D3DLOCK_DISCARD, &vertices); @@ -2025,6 +2172,30 @@ static HRESULT load_skin_mesh_from_xof(IDirectXFileData *filedata, for (i = 0; i < mesh_data.num_vertices; i++) { *(D3DXVECTOR3*)out_ptr = mesh_data.vertices[i]; out_ptr += sizeof(D3DXVECTOR3); + if (mesh_data.fvf & D3DFVF_NORMAL) { + if (duplications[i].normal_index == -1) + ZeroMemory(out_ptr, sizeof(D3DXVECTOR3)); + else + *(D3DXVECTOR3*)out_ptr = mesh_data.normals[duplications[i].normal_index]; + out_ptr += sizeof(D3DXVECTOR3); + } + } + if (mesh_data.fvf & D3DFVF_NORMAL) { + DWORD vertex_size = D3DXGetFVFVertexSize(mesh_data.fvf); + out_ptr = vertices; + for (i = 0; i < mesh_data.num_vertices; i++) { + struct vertex_duplication *dup_ptr; + LIST_FOR_EACH_ENTRY(dup_ptr, &duplications[i].entry, struct vertex_duplication, entry) + { + int j = dup_ptr - duplications; + BYTE *dest_vertex = (BYTE*)vertices + j * vertex_size; + + memcpy(dest_vertex, out_ptr, vertex_size); + dest_vertex += sizeof(D3DXVECTOR3); + *(D3DXVECTOR3*)dest_vertex = mesh_data.normals[dup_ptr->normal_index]; + } + out_ptr += vertex_size; + } } d3dxmesh->lpVtbl->UnlockVertexBuffer(d3dxmesh); @@ -2078,6 +2249,9 @@ cleanup: HeapFree(GetProcessHeap(), 0, mesh_data.vertices); HeapFree(GetProcessHeap(), 0, mesh_data.num_tri_per_face); HeapFree(GetProcessHeap(), 0, mesh_data.indices); + HeapFree(GetProcessHeap(), 0, mesh_data.normals); + HeapFree(GetProcessHeap(), 0, mesh_data.normal_indices); + HeapFree(GetProcessHeap(), 0, duplications); return hr; }
1
0
0
0
Dylan Smith : d3dx9: Add support for loading basic meshes.
by Alexandre Julliard
24 May '11
24 May '11
Module: wine Branch: master Commit: a9ac91054e5d4c3a8038cfdcd672a177b008660c URL:
http://source.winehq.org/git/wine.git/?a=commit;h=a9ac91054e5d4c3a8038cfdcd…
Author: Dylan Smith <dylan.ah.smith(a)gmail.com> Date: Fri May 20 16:25:03 2011 -0400 d3dx9: Add support for loading basic meshes. --- dlls/d3dx9_36/mesh.c | 300 +++++++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 295 insertions(+), 5 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=a9ac91054e5d4c3a8038c…
1
0
0
0
Dylan Smith : d3dx9: Implement D3DXLoadMeshHierarchy for only loading frames.
by Alexandre Julliard
24 May '11
24 May '11
Module: wine Branch: master Commit: bf0979f557911ef8c60e80cef745e6888096cc8c URL:
http://source.winehq.org/git/wine.git/?a=commit;h=bf0979f557911ef8c60e80cef…
Author: Dylan Smith <dylan.ah.smith(a)gmail.com> Date: Fri May 20 16:24:54 2011 -0400 d3dx9: Implement D3DXLoadMeshHierarchy for only loading frames. --- dlls/d3dx9_36/Makefile.in | 2 +- dlls/d3dx9_36/d3dx9_36.spec | 2 +- dlls/d3dx9_36/mesh.c | 221 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 223 insertions(+), 2 deletions(-) diff --git a/dlls/d3dx9_36/Makefile.in b/dlls/d3dx9_36/Makefile.in index 238939e..cba0ea7 100644 --- a/dlls/d3dx9_36/Makefile.in +++ b/dlls/d3dx9_36/Makefile.in @@ -1,6 +1,6 @@ MODULE = d3dx9_36.dll IMPORTLIB = d3dx9 -IMPORTS = d3d9 d3dcompiler ole32 gdi32 user32 +IMPORTS = d3d9 d3dcompiler dxguid d3dxof ole32 gdi32 user32 C_SRCS = \ core.c \ diff --git a/dlls/d3dx9_36/d3dx9_36.spec b/dlls/d3dx9_36/d3dx9_36.spec index 80f34e2..9f42937 100644 --- a/dlls/d3dx9_36/d3dx9_36.spec +++ b/dlls/d3dx9_36/d3dx9_36.spec @@ -174,7 +174,7 @@ @ stub D3DXLoadMeshFromXW(ptr long ptr ptr ptr ptr ptr ptr) @ stub D3DXLoadMeshFromXof(ptr long ptr ptr ptr ptr ptr ptr) @ stub D3DXLoadMeshHierarchyFromXA(ptr long ptr ptr ptr ptr ptr) -@ stub D3DXLoadMeshHierarchyFromXInMemory(ptr long long ptr ptr ptr ptr ptr) +@ stdcall D3DXLoadMeshHierarchyFromXInMemory(ptr long long ptr ptr ptr ptr ptr) @ stub D3DXLoadMeshHierarchyFromXW(ptr long ptr ptr ptr ptr ptr) @ stub D3DXLoadPatchMeshFromXof(ptr long ptr ptr ptr long ptr) @ stub D3DXLoadPRTBufferFromFileA(ptr ptr) diff --git a/dlls/d3dx9_36/mesh.c b/dlls/d3dx9_36/mesh.c index c5954b3..37bbaf0 100644 --- a/dlls/d3dx9_36/mesh.c +++ b/dlls/d3dx9_36/mesh.c @@ -30,6 +30,10 @@ #include "windef.h" #include "wingdi.h" #include "d3dx9.h" +#undef MAKE_DDHRESULT +#include "dxfile.h" +#include "rmxfguid.h" +#include "rmxftmpl.h" #include "wine/debug.h" #include "wine/unicode.h" #include "d3dx9_36_private.h" @@ -1809,6 +1813,223 @@ HRESULT WINAPI D3DXCreateMeshFVF(DWORD numfaces, DWORD numvertices, DWORD option } +static HRESULT get_next_child(IDirectXFileData *filedata, IDirectXFileData **child, const GUID **type) +{ + HRESULT hr; + IDirectXFileDataReference *child_ref = NULL; + IDirectXFileObject *child_obj = NULL; + IDirectXFileData *child_data = NULL; + + hr = IDirectXFileData_GetNextObject(filedata, &child_obj); + if (FAILED(hr)) return hr; + + hr = IDirectXFileObject_QueryInterface(child_obj, &IID_IDirectXFileDataReference, (void**)&child_ref); + if (SUCCEEDED(hr)) { + hr = IDirectXFileDataReference_Resolve(child_ref, &child_data); + IDirectXFileDataReference_Release(child_ref); + } else { + hr = IDirectXFileObject_QueryInterface(child_obj, &IID_IDirectXFileData, (void**)&child_data); + } + IDirectXFileObject_Release(child_obj); + if (FAILED(hr)) + return hr; + + hr = IDirectXFileData_GetType(child_data, type); + if (FAILED(hr)) { + IDirectXFileData_Release(child_data); + } else { + *child = child_data; + } + + return hr; +} + +static HRESULT filedata_get_name(IDirectXFileData *filedata, char **name) +{ + HRESULT hr; + DWORD name_len; + + hr = IDirectXFileData_GetName(filedata, NULL, &name_len); + if (FAILED(hr)) return hr; + + if (!name_len) + name_len++; + *name = HeapAlloc(GetProcessHeap(), 0, name_len); + if (!*name) return E_OUTOFMEMORY; + + hr = IDirectXFileObject_GetName(filedata, *name, &name_len); + if (FAILED(hr)) + HeapFree(GetProcessHeap(), 0, name); + if (!name_len) + (*name)[0] = 0; + + return hr; +} + +static HRESULT parse_transform_matrix(IDirectXFileData *filedata, D3DXMATRIX *transform) +{ + HRESULT hr; + DWORD data_size; + BYTE *data; + + /* template Matrix4x4 { + * array FLOAT matrix[16]; + * } + * template FrameTransformMatrix { + * Matrix4x4 frameMatrix; + * } + */ + + hr = IDirectXFileData_GetData(filedata, NULL, &data_size, (void**)&data); + if (FAILED(hr)) return hr; + + if (data_size != sizeof(D3DXMATRIX)) { + WARN("incorrect data size (%u bytes)\n", data_size); + return E_FAIL; + } + + memcpy(transform, data, sizeof(D3DXMATRIX)); + + return D3D_OK; +} + +static HRESULT load_frame(IDirectXFileData *filedata, + DWORD options, + LPDIRECT3DDEVICE9 device, + LPD3DXALLOCATEHIERARCHY alloc_hier, + D3DXFRAME **frame_out) +{ + HRESULT hr; + const GUID *type; + IDirectXFileData *child; + char *name = NULL; + D3DXFRAME *frame = NULL; + D3DXFRAME **next_child; + + hr = filedata_get_name(filedata, &name); + if (FAILED(hr)) return hr; + + hr = alloc_hier->lpVtbl->CreateFrame(alloc_hier, name, frame_out); + HeapFree(GetProcessHeap(), 0, name); + if (FAILED(hr)) return E_FAIL; + + frame = *frame_out; + D3DXMatrixIdentity(&frame->TransformationMatrix); + next_child = &frame->pFrameFirstChild; + + while (SUCCEEDED(hr = get_next_child(filedata, &child, &type))) + { + if (IsEqualGUID(type, &TID_D3DRMMesh)) { + FIXME("Mesh loading not implemented\n"); + hr = E_NOTIMPL; + } else if (IsEqualGUID(type, &TID_D3DRMFrameTransformMatrix)) { + hr = parse_transform_matrix(child, &frame->TransformationMatrix); + } else if (IsEqualGUID(type, &TID_D3DRMFrame)) { + hr = load_frame(child, options, device, alloc_hier, next_child); + if (SUCCEEDED(hr)) + next_child = &(*next_child)->pFrameSibling; + } + if (FAILED(hr)) break; + } + if (hr == DXFILEERR_NOMOREOBJECTS) + hr = D3D_OK; + + return hr; +} + +HRESULT WINAPI D3DXLoadMeshHierarchyFromXInMemory(LPCVOID memory, + DWORD memory_size, + DWORD options, + LPDIRECT3DDEVICE9 device, + LPD3DXALLOCATEHIERARCHY alloc_hier, + LPD3DXLOADUSERDATA load_user_data, + LPD3DXFRAME *frame_hierarchy, + LPD3DXANIMATIONCONTROLLER *anim_controller) +{ + HRESULT hr; + IDirectXFile *dxfile = NULL; + IDirectXFileEnumObject *enumobj = NULL; + IDirectXFileData *filedata = NULL; + DXFILELOADMEMORY source; + D3DXFRAME *first_frame = NULL; + D3DXFRAME **next_frame = &first_frame; + + TRACE("(%p, %u, %x, %p, %p, %p, %p, %p)\n", memory, memory_size, options, + device, alloc_hier, load_user_data, frame_hierarchy, anim_controller); + + if (!memory || !memory_size || !device || !frame_hierarchy || !alloc_hier) + return D3DERR_INVALIDCALL; + if (load_user_data || anim_controller) { + if (load_user_data) + FIXME("Loading user data not implemented\n"); + if (anim_controller) + FIXME("Animation controller creation not implemented\n"); + return E_NOTIMPL; + } + + hr = DirectXFileCreate(&dxfile); + if (FAILED(hr)) goto cleanup; + + hr = IDirectXFile_RegisterTemplates(dxfile, D3DRM_XTEMPLATES, D3DRM_XTEMPLATE_BYTES); + if (FAILED(hr)) goto cleanup; + + source.lpMemory = (void*)memory; + source.dSize = memory_size; + hr = IDirectXFile_CreateEnumObject(dxfile, &source, DXFILELOAD_FROMMEMORY, &enumobj); + if (FAILED(hr)) goto cleanup; + + while (SUCCEEDED(hr = IDirectXFileEnumObject_GetNextDataObject(enumobj, &filedata))) + { + const GUID *guid = NULL; + + hr = IDirectXFileData_GetType(filedata, &guid); + if (SUCCEEDED(hr)) { + if (IsEqualGUID(guid, &TID_D3DRMMesh)) { + FIXME("Mesh loading not implemented\n"); + hr = E_NOTIMPL; + goto cleanup; + } else if (IsEqualGUID(guid, &TID_D3DRMFrame)) { + hr = load_frame(filedata, options, device, alloc_hier, next_frame); + if (FAILED(hr)) goto cleanup; + } + while (*next_frame) + next_frame = &(*next_frame)->pFrameSibling; + } + + IDirectXFileData_Release(filedata); + filedata = NULL; + if (FAILED(hr)) + goto cleanup; + } + if (hr != DXFILEERR_NOMOREOBJECTS) + goto cleanup; + + if (!first_frame) { + hr = E_FAIL; + } else if (first_frame->pFrameSibling) { + D3DXFRAME *root_frame = NULL; + hr = alloc_hier->lpVtbl->CreateFrame(alloc_hier, NULL, &root_frame); + if (FAILED(hr)) { + hr = E_FAIL; + goto cleanup; + } + D3DXMatrixIdentity(&root_frame->TransformationMatrix); + root_frame->pFrameFirstChild = first_frame; + *frame_hierarchy = root_frame; + hr = D3D_OK; + } else { + *frame_hierarchy = first_frame; + hr = D3D_OK; + } + +cleanup: + if (FAILED(hr) && first_frame) D3DXFrameDestroy(first_frame, alloc_hier); + if (filedata) IDirectXFileData_Release(filedata); + if (enumobj) IDirectXFileEnumObject_Release(enumobj); + if (dxfile) IDirectXFile_Release(dxfile); + return hr; +} + HRESULT WINAPI D3DXFrameDestroy(LPD3DXFRAME frame, LPD3DXALLOCATEHIERARCHY alloc_hier) { HRESULT hr;
1
0
0
0
Jörg Höhle : winmm: Process MCI_DGV_INFO which is larger than MCI_INFO.
by Alexandre Julliard
24 May '11
24 May '11
Module: wine Branch: master Commit: 40dfd72bdb6b3c1be7f7a0d1e3989783f54b7faa URL:
http://source.winehq.org/git/wine.git/?a=commit;h=40dfd72bdb6b3c1be7f7a0d1e…
Author: Jörg Höhle <hoehle(a)users.sourceforge.net> Date: Wed May 18 15:08:11 2011 +0200 winmm: Process MCI_DGV_INFO which is larger than MCI_INFO. --- dlls/winmm/mci.c | 8 +++++--- 1 files changed, 5 insertions(+), 3 deletions(-) diff --git a/dlls/winmm/mci.c b/dlls/winmm/mci.c index 822b1c0..10dd76a 100644 --- a/dlls/winmm/mci.c +++ b/dlls/winmm/mci.c @@ -345,8 +345,8 @@ static int MCI_MapMsgAtoW(UINT msg, DWORD_PTR dwParam1, DWORD_PTR *dwParam2) return 0; case MCI_INFO: { - MCI_INFO_PARMSA *mci_infoA = (MCI_INFO_PARMSA *)*dwParam2; - MCI_INFO_PARMSW *mci_infoW; + MCI_DGV_INFO_PARMSA *mci_infoA = (MCI_DGV_INFO_PARMSA *)*dwParam2; + MCI_DGV_INFO_PARMSW *mci_infoW; DWORD_PTR *ptr; ptr = HeapAlloc(GetProcessHeap(), 0, sizeof(*mci_infoW) + sizeof(DWORD_PTR)); @@ -354,7 +354,7 @@ static int MCI_MapMsgAtoW(UINT msg, DWORD_PTR dwParam1, DWORD_PTR *dwParam2) *ptr++ = *dwParam2; /* save the previous pointer */ *dwParam2 = (DWORD_PTR)ptr; - mci_infoW = (MCI_INFO_PARMSW *)ptr; + mci_infoW = (MCI_DGV_INFO_PARMSW *)ptr; if (dwParam1 & MCI_NOTIFY) mci_infoW->dwCallback = mci_infoA->dwCallback; @@ -362,6 +362,8 @@ static int MCI_MapMsgAtoW(UINT msg, DWORD_PTR dwParam1, DWORD_PTR *dwParam2) /* Size is measured in numbers of characters. */ mci_infoW->dwRetSize = mci_infoA->dwRetSize; mci_infoW->lpstrReturn = HeapAlloc(GetProcessHeap(), 0, mci_infoW->dwRetSize * sizeof(WCHAR)); + if (dwParam1 & MCI_DGV_INFO_ITEM) + mci_infoW->dwItem = mci_infoA->dwItem; return 1; } case MCI_SAVE:
1
0
0
0
Jörg Höhle : msvfw32: Force lower-case 'vidc/vids /audc' etc. when opening new driver.
by Alexandre Julliard
24 May '11
24 May '11
Module: wine Branch: master Commit: 0e566c5b645572d6ce17cc05a1e815a93838a7f3 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=0e566c5b645572d6ce17cc05a…
Author: Jörg Höhle <hoehle(a)users.sourceforge.net> Date: Tue Apr 19 07:18:23 2011 +0200 msvfw32: Force lower-case 'vidc/vids/audc' etc. when opening new driver. --- dlls/msvfw32/msvideo_main.c | 14 +++++++++++--- 1 files changed, 11 insertions(+), 3 deletions(-) diff --git a/dlls/msvfw32/msvideo_main.c b/dlls/msvfw32/msvideo_main.c index c5b404d..f27d3ec 100644 --- a/dlls/msvfw32/msvideo_main.c +++ b/dlls/msvfw32/msvideo_main.c @@ -403,9 +403,11 @@ HIC VFWAPI ICOpen(DWORD fccType, DWORD fccHandler, UINT wMode) driver = reg_driver_list; while(driver) if (!compare_fourcc(fccType, driver->fccType) && - !compare_fourcc(fccHandler, driver->fccHandler)) + !compare_fourcc(fccHandler, driver->fccHandler)) { + fccType = driver->fccType; + fccHandler = driver->fccHandler; break; - else + } else driver = driver->next; if (driver && driver->proc) @@ -426,7 +428,13 @@ HIC VFWAPI ICOpen(DWORD fccType, DWORD fccHandler, UINT wMode) icopen.dnDevNode = 0; /* FIXME */ if (!driver) { - /* The driver is registered in the registry */ + /* normalize to lower case as in 'vidc' */ + ((char*)&fccType)[0] = tolower(((char*)&fccType)[0]); + ((char*)&fccType)[1] = tolower(((char*)&fccType)[1]); + ((char*)&fccType)[2] = tolower(((char*)&fccType)[2]); + ((char*)&fccType)[3] = tolower(((char*)&fccType)[3]); + icopen.fccType = fccType; + /* Seek the driver in the registry */ fourcc_to_string(codecname, fccType); codecname[4] = '.'; fourcc_to_string(codecname + 5, fccHandler);
1
0
0
0
Aric Stewart : usp10/test: Add Lao shaping test.
by Alexandre Julliard
24 May '11
24 May '11
Module: wine Branch: master Commit: b22b80019a31a8981b104812e4a0d9e8e8b219fc URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b22b80019a31a8981b104812e…
Author: Aric Stewart <aric(a)codeweavers.com> Date: Tue May 24 09:43:33 2011 -0500 usp10/test: Add Lao shaping test. --- dlls/usp10/tests/usp10.c | 22 ++++++++++++++++++++++ 1 files changed, 22 insertions(+), 0 deletions(-) diff --git a/dlls/usp10/tests/usp10.c b/dlls/usp10/tests/usp10.c index 7dddcd3..ac78514 100644 --- a/dlls/usp10/tests/usp10.c +++ b/dlls/usp10/tests/usp10.c @@ -619,6 +619,20 @@ static void test_ScriptShapeOpenType(HDC hdc) {1,{{SCRIPT_JUSTIFY_CHARACTER,1,0,0,0,0},0}}, {1,{{SCRIPT_JUSTIFY_NONE,1,0,0,0,0},0}} }; + /* Lao */ + static const WCHAR test_lao[] = {0x0ead, 0x0eb1, 0x0e81, 0x0eaa, 0x0ead, 0x0e99, 0x0ea5, 0x0eb2, 0x0ea7, 0}; + static const shapeTest_char lao_c[] = {{0,{0,0}},{0,{0,0}},{2,{0,0}},{3,{0,0}},{4,{0,0}},{5,{0,0}},{6,{0,0}},{7,{0,0}},{8,{0,0}}}; + static const shapeTest_glyph lao_g[] = { + {1,{{SCRIPT_JUSTIFY_NONE,1,0,0,0,0},0}}, + {1,{{SCRIPT_JUSTIFY_CHARACTER,0,1,1,0,0},0}}, + {1,{{SCRIPT_JUSTIFY_CHARACTER,1,0,0,0,0},0}}, + {1,{{SCRIPT_JUSTIFY_CHARACTER,1,0,0,0,0},0}}, + {1,{{SCRIPT_JUSTIFY_CHARACTER,1,0,0,0,0},0}}, + {1,{{SCRIPT_JUSTIFY_CHARACTER,1,0,0,0,0},0}}, + {1,{{SCRIPT_JUSTIFY_CHARACTER,1,0,0,0,0},0}}, + {1,{{SCRIPT_JUSTIFY_CHARACTER,1,0,0,0,0},0}}, + {1,{{SCRIPT_JUSTIFY_NONE,1,0,0,0,0},0}} }; + if (!pScriptItemizeOpenType || !pScriptShapeOpenType) { win_skip("ScriptShapeOpenType not available on this platform\n"); @@ -699,6 +713,14 @@ static void test_ScriptShapeOpenType(HDC hdc) SelectObject(hdc, hfont_orig); DeleteObject(hfont); } + + test_valid = find_font_for_range(hdc, "DokChampa", 25, test_lao[0], &hfont, &hfont_orig); + if (hfont != NULL) + { + test_shape_ok_valid(test_valid, hdc, test_lao, 9, &Control, &State, 0, 9, lao_c, lao_g); + SelectObject(hdc, hfont_orig); + DeleteObject(hfont); + } } static void test_ScriptShape(HDC hdc)
1
0
0
0
Aric Stewart : usp10/test: Add Phags-pa shaping test.
by Alexandre Julliard
24 May '11
24 May '11
Module: wine Branch: master Commit: 852c8fd60e73d54fb38be4b48e313aabb6bcf01e URL:
http://source.winehq.org/git/wine.git/?a=commit;h=852c8fd60e73d54fb38be4b48…
Author: Aric Stewart <aric(a)codeweavers.com> Date: Tue May 24 09:43:30 2011 -0500 usp10/test: Add Phags-pa shaping test. --- dlls/usp10/tests/usp10.c | 24 ++++++++++++++++++++++++ 1 files changed, 24 insertions(+), 0 deletions(-) diff --git a/dlls/usp10/tests/usp10.c b/dlls/usp10/tests/usp10.c index 33469d5..7dddcd3 100644 --- a/dlls/usp10/tests/usp10.c +++ b/dlls/usp10/tests/usp10.c @@ -603,6 +603,22 @@ static void test_ScriptShapeOpenType(HDC hdc) {1,{{SCRIPT_JUSTIFY_NONE,0,1,1,0,0},0}}, {1,{{SCRIPT_JUSTIFY_NONE,1,0,0,0,0},0}} }; + /* Phags-pa */ + static const WCHAR test_phagspa[] = {0xa84f, 0xa861, 0xa843, 0x0020, 0xa863, 0xa861, 0xa859, 0x0020, 0xa850, 0xa85c, 0xa85e}; + static const shapeTest_char phagspa_c[] = {{0,{0,0}},{1,{0,0}},{2,{0,0}},{3,{1,0}},{4,{0,0}},{5,{0,0}},{6,{0,0}},{7,{1,0}},{8,{0,0}},{9,{0,0}},{10,{0,0}}}; + static const shapeTest_glyph phagspa_g[] = { + {1,{{SCRIPT_JUSTIFY_CHARACTER,1,0,0,0,0},0}}, + {1,{{SCRIPT_JUSTIFY_CHARACTER,1,0,0,0,0},0}}, + {1,{{SCRIPT_JUSTIFY_CHARACTER,1,0,0,0,0},0}}, + {1,{{SCRIPT_JUSTIFY_CHARACTER,1,0,0,0,0},0}}, + {1,{{SCRIPT_JUSTIFY_CHARACTER,1,0,0,0,0},0}}, + {1,{{SCRIPT_JUSTIFY_CHARACTER,1,0,0,0,0},0}}, + {1,{{SCRIPT_JUSTIFY_CHARACTER,1,0,0,0,0},0}}, + {1,{{SCRIPT_JUSTIFY_CHARACTER,1,0,0,0,0},0}}, + {1,{{SCRIPT_JUSTIFY_CHARACTER,1,0,0,0,0},0}}, + {1,{{SCRIPT_JUSTIFY_CHARACTER,1,0,0,0,0},0}}, + {1,{{SCRIPT_JUSTIFY_NONE,1,0,0,0,0},0}} }; + if (!pScriptItemizeOpenType || !pScriptShapeOpenType) { win_skip("ScriptShapeOpenType not available on this platform\n"); @@ -675,6 +691,14 @@ static void test_ScriptShapeOpenType(HDC hdc) SelectObject(hdc, hfont_orig); DeleteObject(hfont); } + + test_valid = find_font_for_range(hdc, "Microsoft PhagsPa", 53, test_phagspa[0], &hfont, &hfont_orig); + if (hfont != NULL) + { + test_shape_ok_valid(test_valid, hdc, test_phagspa, 11, &Control, &State, 0, 11, phagspa_c, phagspa_g); + SelectObject(hdc, hfont_orig); + DeleteObject(hfont); + } } static void test_ScriptShape(HDC hdc)
1
0
0
0
← Newer
1
...
19
20
21
22
23
24
25
...
95
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
Results per page:
10
25
50
100
200