Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
b89c32b2
Commit
b89c32b2
authored
Mar 16, 2012
by
Christian Costa
Committed by
Alexandre Julliard
Mar 16, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3drm: If there is no texture coordinates in loaded mesh, generate default…
d3drm: If there is no texture coordinates in loaded mesh, generate default texture coordinates for each vertex.
parent
ea532f63
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
61 additions
and
7 deletions
+61
-7
meshbuilder.c
dlls/d3drm/meshbuilder.c
+13
-1
d3drm.c
dlls/d3drm/tests/d3drm.c
+48
-6
No files found.
dlls/d3drm/meshbuilder.c
View file @
b89c32b2
...
@@ -1272,6 +1272,18 @@ static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_Load(IDirect3DRMMeshBuilder3*
...
@@ -1272,6 +1272,18 @@ static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_Load(IDirect3DRMMeshBuilder3*
/* Set size (in number of DWORD) of all faces data */
/* Set size (in number of DWORD) of all faces data */
This
->
face_data_size
=
faces_data_size
;
This
->
face_data_size
=
faces_data_size
;
/* If there is no texture coordinates, generate default texture coordinates (0.0f, 0.0f) for each vertex */
if
(
!
This
->
pCoords2d
)
{
This
->
nb_coords2d
=
This
->
nb_vertices
;
This
->
pCoords2d
=
HeapAlloc
(
GetProcessHeap
(),
0
,
This
->
nb_coords2d
*
sizeof
(
Coords2d
));
for
(
i
=
0
;
i
<
This
->
nb_coords2d
;
i
++
)
{
This
->
pCoords2d
[
i
].
u
=
0
.
0
f
;
This
->
pCoords2d
[
i
].
v
=
0
.
0
f
;
}
}
ret
=
D3DRM_OK
;
ret
=
D3DRM_OK
;
end:
end:
...
@@ -1603,7 +1615,7 @@ static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_GetTextureCoordinates(IDirect3
...
@@ -1603,7 +1615,7 @@ static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_GetTextureCoordinates(IDirect3
TRACE
(
"(%p)->(%d,%p,%p)
\n
"
,
This
,
index
,
u
,
v
);
TRACE
(
"(%p)->(%d,%p,%p)
\n
"
,
This
,
index
,
u
,
v
);
if
(
index
>=
This
->
nb_coords2d
)
if
(
index
>=
This
->
nb_coords2d
)
return
D3DRMERR_
NOTFOUND
;
return
D3DRMERR_
BADVALUE
;
*
u
=
This
->
pCoords2d
[
index
].
u
;
*
u
=
This
->
pCoords2d
[
index
].
u
;
*
v
=
This
->
pCoords2d
[
index
].
v
;
*
v
=
This
->
pCoords2d
[
index
].
v
;
...
...
dlls/d3drm/tests/d3drm.c
View file @
b89c32b2
...
@@ -180,12 +180,33 @@ static void test_MeshBuilder(void)
...
@@ -180,12 +180,33 @@ static void test_MeshBuilder(void)
todo_wine
ok
(
val2
==
4
,
"Wrong number of normals %d (must be 4)
\n
"
,
val2
);
todo_wine
ok
(
val2
==
4
,
"Wrong number of normals %d (must be 4)
\n
"
,
val2
);
ok
(
val3
==
22
,
"Wrong number of face data bytes %d (must be 22)
\n
"
,
val3
);
ok
(
val3
==
22
,
"Wrong number of face data bytes %d (must be 22)
\n
"
,
val3
);
/* Check that Load method generated default texture coordinates (0.0f, 0.0f) for each vertex */
valu
=
1
.
23
f
;
valv
=
3
.
21
f
;
hr
=
IDirect3DRMMeshBuilder_GetTextureCoordinates
(
pMeshBuilder
,
0
,
&
valu
,
&
valv
);
ok
(
hr
==
D3DRM_OK
,
"Cannot get texture coordinates (hr = %x)
\n
"
,
hr
);
ok
(
valu
==
0
.
0
f
,
"Wrong coordinate %f (must be 0.0)
\n
"
,
valu
);
ok
(
valv
==
0
.
0
f
,
"Wrong coordinate %f (must be 0.0)
\n
"
,
valv
);
valu
=
1
.
23
f
;
valu
=
1
.
23
f
;
valv
=
3
.
21
f
;
valv
=
3
.
21
f
;
hr
=
IDirect3DRMMeshBuilder_GetTextureCoordinates
(
pMeshBuilder
,
1
,
&
valu
,
&
valv
);
hr
=
IDirect3DRMMeshBuilder_GetTextureCoordinates
(
pMeshBuilder
,
1
,
&
valu
,
&
valv
);
todo_wine
ok
(
hr
==
D3DRM_OK
,
"Cannot get texture coordinates (hr = %x)
\n
"
,
hr
);
ok
(
hr
==
D3DRM_OK
,
"Cannot get texture coordinates (hr = %x)
\n
"
,
hr
);
todo_wine
ok
(
valu
==
0
.
0
f
,
"Wrong coordinate %f (must be 0.0)
\n
"
,
valu
);
ok
(
valu
==
0
.
0
f
,
"Wrong coordinate %f (must be 0.0)
\n
"
,
valu
);
todo_wine
ok
(
valv
==
0
.
0
f
,
"Wrong coordinate %f (must be 0.0)
\n
"
,
valv
);
ok
(
valv
==
0
.
0
f
,
"Wrong coordinate %f (must be 0.0)
\n
"
,
valv
);
valu
=
1
.
23
f
;
valv
=
3
.
21
f
;
hr
=
IDirect3DRMMeshBuilder_GetTextureCoordinates
(
pMeshBuilder
,
2
,
&
valu
,
&
valv
);
ok
(
hr
==
D3DRM_OK
,
"Cannot get texture coordinates (hr = %x)
\n
"
,
hr
);
ok
(
valu
==
0
.
0
f
,
"Wrong coordinate %f (must be 0.0)
\n
"
,
valu
);
ok
(
valv
==
0
.
0
f
,
"Wrong coordinate %f (must be 0.0)
\n
"
,
valv
);
valu
=
1
.
23
f
;
valv
=
3
.
21
f
;
hr
=
IDirect3DRMMeshBuilder_GetTextureCoordinates
(
pMeshBuilder
,
3
,
&
valu
,
&
valv
);
ok
(
hr
==
D3DRM_OK
,
"Cannot get texture coordinates (hr = %x)
\n
"
,
hr
);
ok
(
valu
==
0
.
0
f
,
"Wrong coordinate %f (must be 0.0)
\n
"
,
valu
);
ok
(
valv
==
0
.
0
f
,
"Wrong coordinate %f (must be 0.0)
\n
"
,
valv
);
hr
=
IDirect3DRMMeshBuilder_GetTextureCoordinates
(
pMeshBuilder
,
4
,
&
valu
,
&
valv
);
ok
(
hr
==
D3DRMERR_BADVALUE
,
"Should fail and return D3DRM_BADVALUE (hr = %x)
\n
"
,
hr
);
valu
=
1
.
23
f
;
valu
=
1
.
23
f
;
valv
=
3
.
21
f
;
valv
=
3
.
21
f
;
...
@@ -302,12 +323,33 @@ static void test_MeshBuilder3(void)
...
@@ -302,12 +323,33 @@ static void test_MeshBuilder3(void)
ok
(
hr
==
D3DRM_OK
,
"Cannot get vertices information (hr = %x)
\n
"
,
hr
);
ok
(
hr
==
D3DRM_OK
,
"Cannot get vertices information (hr = %x)
\n
"
,
hr
);
ok
(
val1
==
4
,
"Wrong number of vertices %d (must be 4)
\n
"
,
val1
);
ok
(
val1
==
4
,
"Wrong number of vertices %d (must be 4)
\n
"
,
val1
);
/* Check that Load method generated default texture coordinates (0.0f, 0.0f) for each vertex */
valu
=
1
.
23
f
;
valv
=
3
.
21
f
;
hr
=
IDirect3DRMMeshBuilder3_GetTextureCoordinates
(
pMeshBuilder3
,
0
,
&
valu
,
&
valv
);
ok
(
hr
==
D3DRM_OK
,
"Cannot get texture coordinates (hr = %x)
\n
"
,
hr
);
ok
(
valu
==
0
.
0
f
,
"Wrong coordinate %f (must be 0.0)
\n
"
,
valu
);
ok
(
valv
==
0
.
0
f
,
"Wrong coordinate %f (must be 0.0)
\n
"
,
valv
);
valu
=
1
.
23
f
;
valu
=
1
.
23
f
;
valv
=
3
.
21
f
;
valv
=
3
.
21
f
;
hr
=
IDirect3DRMMeshBuilder3_GetTextureCoordinates
(
pMeshBuilder3
,
1
,
&
valu
,
&
valv
);
hr
=
IDirect3DRMMeshBuilder3_GetTextureCoordinates
(
pMeshBuilder3
,
1
,
&
valu
,
&
valv
);
todo_wine
ok
(
hr
==
D3DRM_OK
,
"Cannot get texture coordinates (hr = %x)
\n
"
,
hr
);
ok
(
hr
==
D3DRM_OK
,
"Cannot get texture coordinates (hr = %x)
\n
"
,
hr
);
todo_wine
ok
(
valu
==
0
.
0
f
,
"Wrong coordinate %f (must be 0.0)
\n
"
,
valu
);
ok
(
valu
==
0
.
0
f
,
"Wrong coordinate %f (must be 0.0)
\n
"
,
valu
);
todo_wine
ok
(
valv
==
0
.
0
f
,
"Wrong coordinate %f (must be 0.0)
\n
"
,
valv
);
ok
(
valv
==
0
.
0
f
,
"Wrong coordinate %f (must be 0.0)
\n
"
,
valv
);
valu
=
1
.
23
f
;
valv
=
3
.
21
f
;
hr
=
IDirect3DRMMeshBuilder3_GetTextureCoordinates
(
pMeshBuilder3
,
2
,
&
valu
,
&
valv
);
ok
(
hr
==
D3DRM_OK
,
"Cannot get texture coordinates (hr = %x)
\n
"
,
hr
);
ok
(
valu
==
0
.
0
f
,
"Wrong coordinate %f (must be 0.0)
\n
"
,
valu
);
ok
(
valv
==
0
.
0
f
,
"Wrong coordinate %f (must be 0.0)
\n
"
,
valv
);
valu
=
1
.
23
f
;
valv
=
3
.
21
f
;
hr
=
IDirect3DRMMeshBuilder3_GetTextureCoordinates
(
pMeshBuilder3
,
3
,
&
valu
,
&
valv
);
ok
(
hr
==
D3DRM_OK
,
"Cannot get texture coordinates (hr = %x)
\n
"
,
hr
);
ok
(
valu
==
0
.
0
f
,
"Wrong coordinate %f (must be 0.0)
\n
"
,
valu
);
ok
(
valv
==
0
.
0
f
,
"Wrong coordinate %f (must be 0.0)
\n
"
,
valv
);
hr
=
IDirect3DRMMeshBuilder3_GetTextureCoordinates
(
pMeshBuilder3
,
4
,
&
valu
,
&
valv
);
ok
(
hr
==
D3DRMERR_BADVALUE
,
"Should fail and return D3DRM_BADVALUE (hr = %x)
\n
"
,
hr
);
valu
=
1
.
23
f
;
valu
=
1
.
23
f
;
valv
=
3
.
21
f
;
valv
=
3
.
21
f
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment