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
02931810
Commit
02931810
authored
Jun 17, 2012
by
André Hentschel
Committed by
Alexandre Julliard
Jun 18, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3drm: Implement IDirect3DRMMaterial2_GetClassName.
parent
00773fea
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
94 additions
and
6 deletions
+94
-6
material.c
dlls/d3drm/material.c
+8
-2
d3drm.c
dlls/d3drm/tests/d3drm.c
+86
-4
No files found.
dlls/d3drm/material.c
View file @
02931810
...
...
@@ -160,9 +160,15 @@ static HRESULT WINAPI IDirect3DRMMaterial2Impl_GetName(IDirect3DRMMaterial2* ifa
static
HRESULT
WINAPI
IDirect3DRMMaterial2Impl_GetClassName
(
IDirect3DRMMaterial2
*
iface
,
LPDWORD
size
,
LPSTR
name
)
{
FIXME
(
"(%p)->(%p, %p): stub
\n
"
,
iface
,
size
,
name
);
TRACE
(
"(%p)->(%p, %p)
\n
"
,
iface
,
size
,
name
);
return
E_NOTIMPL
;
if
(
!
size
||
*
size
<
strlen
(
"Material"
)
||
!
name
)
return
E_INVALIDARG
;
strcpy
(
name
,
"Material"
);
*
size
=
sizeof
(
"Material"
);
return
D3DRM_OK
;
}
/*** IDirect3DRMMaterial methods ***/
...
...
dlls/d3drm/tests/d3drm.c
View file @
02931810
...
...
@@ -208,7 +208,7 @@ static void test_MeshBuilder(void)
size
=
sizeof
(
cname
);
hr
=
IDirect3DRMMeshBuilder_GetClassName
(
pMeshBuilder
,
&
size
,
cname
);
ok
(
hr
==
D3DRM_OK
,
"Cannot get classname (hr = %x)
\n
"
,
hr
);
ok
(
size
==
sizeof
(
"Builder"
),
"wrong s
trlen
: %u
\n
"
,
size
);
ok
(
size
==
sizeof
(
"Builder"
),
"wrong s
ize
: %u
\n
"
,
size
);
ok
(
!
strcmp
(
cname
,
"Builder"
),
"Expected cname to be
\"
Builder
\"
, but got
\"
%s
\"\n
"
,
cname
);
info
.
lpMemory
=
data_bad_version
;
...
...
@@ -478,7 +478,7 @@ static void test_MeshBuilder3(void)
size
=
sizeof
(
cname
);
hr
=
IDirect3DRMMeshBuilder3_GetClassName
(
pMeshBuilder3
,
&
size
,
cname
);
ok
(
hr
==
D3DRM_OK
,
"Cannot get classname (hr = %x)
\n
"
,
hr
);
ok
(
size
==
sizeof
(
"Builder"
),
"wrong s
trlen
: %u
\n
"
,
size
);
ok
(
size
==
sizeof
(
"Builder"
),
"wrong s
ize
: %u
\n
"
,
size
);
ok
(
!
strcmp
(
cname
,
"Builder"
),
"Expected cname to be
\"
Builder
\"
, but got
\"
%s
\"\n
"
,
cname
);
info
.
lpMemory
=
data_bad_version
;
...
...
@@ -621,7 +621,7 @@ static void test_Frame(void)
count
=
sizeof
(
cname
);
hr
=
IDirect3DRMFrame_GetClassName
(
pFrameC
,
&
count
,
cname
);
ok
(
hr
==
D3DRM_OK
,
"Cannot get classname (hr = %x)
\n
"
,
hr
);
ok
(
count
==
sizeof
(
"Frame"
),
"wrong s
trlen
: %u
\n
"
,
count
);
ok
(
count
==
sizeof
(
"Frame"
),
"wrong s
ize
: %u
\n
"
,
count
);
ok
(
!
strcmp
(
cname
,
"Frame"
),
"Expected cname to be
\"
Frame
\"
, but got
\"
%s
\"\n
"
,
cname
);
hr
=
IDirect3DRMFrame_GetParent
(
pFrameC
,
NULL
);
...
...
@@ -931,7 +931,7 @@ static void test_Light(void)
size
=
sizeof
(
cname
);
hr
=
IDirect3DRMLight_GetClassName
(
pLight
,
&
size
,
cname
);
ok
(
hr
==
D3DRM_OK
,
"Cannot get classname (hr = %x)
\n
"
,
hr
);
ok
(
size
==
sizeof
(
"Light"
),
"wrong s
trlen
: %u
\n
"
,
size
);
ok
(
size
==
sizeof
(
"Light"
),
"wrong s
ize
: %u
\n
"
,
size
);
ok
(
!
strcmp
(
cname
,
"Light"
),
"Expected cname to be
\"
Light
\"
, but got
\"
%s
\"\n
"
,
cname
);
type
=
IDirect3DRMLight_GetType
(
pLight
);
...
...
@@ -960,6 +960,87 @@ static void test_Light(void)
IDirect3DRM_Release
(
pD3DRM
);
}
static
void
test_Material2
(
void
)
{
HRESULT
hr
;
LPDIRECT3DRM
pD3DRM
;
LPDIRECT3DRM3
pD3DRM3
;
LPDIRECT3DRMMATERIAL2
pMaterial2
;
D3DVALUE
r
,
g
,
b
;
DWORD
size
;
CHAR
cname
[
64
]
=
{
0
};
hr
=
pDirect3DRMCreate
(
&
pD3DRM
);
ok
(
hr
==
D3DRM_OK
,
"Cannot get IDirect3DRM interface (hr = %x)
\n
"
,
hr
);
hr
=
IDirect3DRM_QueryInterface
(
pD3DRM
,
&
IID_IDirect3DRM3
,
(
LPVOID
*
)
&
pD3DRM3
);
if
(
FAILED
(
hr
))
{
win_skip
(
"Cannot get IDirect3DRM3 interface (hr = %x), skipping tests
\n
"
,
hr
);
IDirect3DRM_Release
(
pD3DRM
);
return
;
}
hr
=
IDirect3DRM3_CreateMaterial
(
pD3DRM3
,
18
.
5
f
,
&
pMaterial2
);
ok
(
hr
==
D3DRM_OK
,
"Cannot get IDirect3DRMMaterial2 interface (hr = %x)
\n
"
,
hr
);
hr
=
IDirect3DRMMaterial2_GetClassName
(
pMaterial2
,
NULL
,
cname
);
ok
(
hr
==
E_INVALIDARG
,
"GetClassName failed with %x
\n
"
,
hr
);
hr
=
IDirect3DRMMaterial2_GetClassName
(
pMaterial2
,
NULL
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"GetClassName failed with %x
\n
"
,
hr
);
size
=
1
;
hr
=
IDirect3DRMMaterial2_GetClassName
(
pMaterial2
,
&
size
,
cname
);
ok
(
hr
==
E_INVALIDARG
,
"GetClassName failed with %x
\n
"
,
hr
);
size
=
sizeof
(
cname
);
hr
=
IDirect3DRMMaterial2_GetClassName
(
pMaterial2
,
&
size
,
cname
);
ok
(
hr
==
D3DRM_OK
,
"Cannot get classname (hr = %x)
\n
"
,
hr
);
ok
(
size
==
sizeof
(
"Material"
),
"wrong size: %u
\n
"
,
size
);
ok
(
!
strcmp
(
cname
,
"Material"
),
"Expected cname to be
\"
Material
\"
, but got
\"
%s
\"\n
"
,
cname
);
r
=
IDirect3DRMMaterial2_GetPower
(
pMaterial2
);
ok
(
r
==
18
.
5
f
,
"wrong power (%f)
\n
"
,
r
);
hr
=
IDirect3DRMMaterial2_GetEmissive
(
pMaterial2
,
&
r
,
&
g
,
&
b
);
ok
(
hr
==
D3DRM_OK
,
"Cannot get emissive (hr = %x)
\n
"
,
hr
);
ok
(
r
==
0
.
0
f
&&
g
==
0
.
0
f
&&
b
==
0
.
0
f
,
"wrong emissive r=%f g=%f b=%f, expected r=0.0 g=0.0 b=0.0
\n
"
,
r
,
g
,
b
);
hr
=
IDirect3DRMMaterial2_GetSpecular
(
pMaterial2
,
&
r
,
&
g
,
&
b
);
ok
(
hr
==
D3DRM_OK
,
"Cannot get emissive (hr = %x)
\n
"
,
hr
);
todo_wine
ok
(
r
==
1
.
0
f
&&
g
==
1
.
0
f
&&
b
==
1
.
0
f
,
"wrong specular r=%f g=%f b=%f, expected r=1.0 g=1.0 b=1.0
\n
"
,
r
,
g
,
b
);
hr
=
IDirect3DRMMaterial2_GetAmbient
(
pMaterial2
,
&
r
,
&
g
,
&
b
);
ok
(
hr
==
D3DRM_OK
,
"Cannot get emissive (hr = %x)
\n
"
,
hr
);
ok
(
r
==
0
.
0
f
&&
g
==
0
.
0
f
&&
b
==
0
.
0
f
,
"wrong ambient r=%f g=%f b=%f, expected r=0.0 g=0.0 b=0.0
\n
"
,
r
,
g
,
b
);
hr
=
IDirect3DRMMaterial2_SetPower
(
pMaterial2
,
5
.
87
f
);
ok
(
hr
==
D3DRM_OK
,
"Cannot set power (hr = %x)
\n
"
,
hr
);
r
=
IDirect3DRMMaterial2_GetPower
(
pMaterial2
);
ok
(
r
==
5
.
87
f
,
"wrong power (%f)
\n
"
,
r
);
hr
=
IDirect3DRMMaterial2_SetEmissive
(
pMaterial2
,
0
.
5
f
,
0
.
5
f
,
0
.
5
f
);
ok
(
hr
==
D3DRM_OK
,
"Cannot set emissive (hr = %x)
\n
"
,
hr
);
hr
=
IDirect3DRMMaterial2_GetEmissive
(
pMaterial2
,
&
r
,
&
g
,
&
b
);
ok
(
hr
==
D3DRM_OK
,
"Cannot get emissive (hr = %x)
\n
"
,
hr
);
ok
(
r
==
0
.
5
f
&&
g
==
0
.
5
f
&&
b
==
0
.
5
f
,
"wrong emissive r=%f g=%f b=%f, expected r=0.5 g=0.5 b=0.5
\n
"
,
r
,
g
,
b
);
hr
=
IDirect3DRMMaterial2_SetSpecular
(
pMaterial2
,
0
.
6
f
,
0
.
6
f
,
0
.
6
f
);
ok
(
hr
==
D3DRM_OK
,
"Cannot set specular (hr = %x)
\n
"
,
hr
);
hr
=
IDirect3DRMMaterial2_GetSpecular
(
pMaterial2
,
&
r
,
&
g
,
&
b
);
ok
(
hr
==
D3DRM_OK
,
"Cannot get specular (hr = %x)
\n
"
,
hr
);
ok
(
r
==
0
.
6
f
&&
g
==
0
.
6
f
&&
b
==
0
.
6
f
,
"wrong specular r=%f g=%f b=%f, expected r=0.6 g=0.6 b=0.6
\n
"
,
r
,
g
,
b
);
hr
=
IDirect3DRMMaterial2_SetAmbient
(
pMaterial2
,
0
.
7
f
,
0
.
7
f
,
0
.
7
f
);
ok
(
hr
==
D3DRM_OK
,
"Cannot set ambient (hr = %x)
\n
"
,
hr
);
hr
=
IDirect3DRMMaterial2_GetAmbient
(
pMaterial2
,
&
r
,
&
g
,
&
b
);
ok
(
hr
==
D3DRM_OK
,
"Cannot get ambient (hr = %x)
\n
"
,
hr
);
ok
(
r
==
0
.
7
f
&&
g
==
0
.
7
f
&&
b
==
0
.
7
f
,
"wrong ambient r=%f g=%f b=%f, expected r=0.7 g=0.7 b=0.7
\n
"
,
r
,
g
,
b
);
IDirect3DRMMaterial2_Release
(
pMaterial2
);
IDirect3DRM3_Release
(
pD3DRM3
);
IDirect3DRM_Release
(
pD3DRM
);
}
static
void
test_frame_transform
(
void
)
{
HRESULT
hr
;
...
...
@@ -1026,6 +1107,7 @@ START_TEST(d3drm)
test_Mesh
();
test_Frame
();
test_Light
();
test_Material2
();
test_frame_transform
();
test_d3drm_load
();
...
...
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