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
02bb70fc
Commit
02bb70fc
authored
Nov 20, 2011
by
Henri Verbeet
Committed by
Alexandre Julliard
Nov 21, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Get rid of the WINED3DMATERIAL typedef.
parent
f5973597
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
66 additions
and
64 deletions
+66
-64
device.c
dlls/d3d8/device.c
+4
-4
device.c
dlls/d3d9/device.c
+4
-4
device.c
dlls/ddraw/device.c
+4
-4
device.c
dlls/wined3d/device.c
+15
-15
state.c
dlls/wined3d/state.c
+29
-27
wined3d_private.h
dlls/wined3d/wined3d_private.h
+1
-1
wined3d.h
include/wine/wined3d.h
+9
-9
No files found.
dlls/d3d8/device.c
View file @
02bb70fc
...
...
@@ -1311,9 +1311,9 @@ static HRESULT WINAPI IDirect3DDevice8Impl_SetMaterial(IDirect3DDevice8 *iface,
TRACE
(
"iface %p, material %p.
\n
"
,
iface
,
pMaterial
);
/* Note: D3DMATERIAL8 is compatible with
WINED3DMATERIAL
*/
/* Note: D3DMATERIAL8 is compatible with
struct wined3d_material.
*/
wined3d_mutex_lock
();
hr
=
wined3d_device_set_material
(
This
->
wined3d_device
,
(
const
WINED3DMATERIAL
*
)
pMaterial
);
hr
=
wined3d_device_set_material
(
This
->
wined3d_device
,
(
const
struct
wined3d_material
*
)
pMaterial
);
wined3d_mutex_unlock
();
return
hr
;
...
...
@@ -1327,9 +1327,9 @@ static HRESULT WINAPI IDirect3DDevice8Impl_GetMaterial(IDirect3DDevice8 *iface,
TRACE
(
"iface %p, material %p.
\n
"
,
iface
,
pMaterial
);
/* Note: D3DMATERIAL8 is compatible with
WINED3DMATERIAL
*/
/* Note: D3DMATERIAL8 is compatible with
struct wined3d_material.
*/
wined3d_mutex_lock
();
hr
=
wined3d_device_get_material
(
This
->
wined3d_device
,
(
WINED3DMATERIAL
*
)
pMaterial
);
hr
=
wined3d_device_get_material
(
This
->
wined3d_device
,
(
struct
wined3d_material
*
)
pMaterial
);
wined3d_mutex_unlock
();
return
hr
;
...
...
dlls/d3d9/device.c
View file @
02bb70fc
...
...
@@ -1329,9 +1329,9 @@ static HRESULT WINAPI IDirect3DDevice9Impl_SetMaterial(IDirect3DDevice9Ex *iface
TRACE
(
"iface %p, material %p.
\n
"
,
iface
,
pMaterial
);
/* Note: D3DMATERIAL9 is compatible with
WINED3DMATERIAL
*/
/* Note: D3DMATERIAL9 is compatible with
struct wined3d_material.
*/
wined3d_mutex_lock
();
hr
=
wined3d_device_set_material
(
This
->
wined3d_device
,
(
const
WINED3DMATERIAL
*
)
pMaterial
);
hr
=
wined3d_device_set_material
(
This
->
wined3d_device
,
(
const
struct
wined3d_material
*
)
pMaterial
);
wined3d_mutex_unlock
();
return
hr
;
...
...
@@ -1345,9 +1345,9 @@ static HRESULT WINAPI IDirect3DDevice9Impl_GetMaterial(IDirect3DDevice9Ex *iface
TRACE
(
"iface %p, material %p.
\n
"
,
iface
,
pMaterial
);
/* Note: D3DMATERIAL9 is compatible with
WINED3DMATERIAL
*/
/* Note: D3DMATERIAL9 is compatible with
struct wined3d_material.
*/
wined3d_mutex_lock
();
hr
=
wined3d_device_get_material
(
This
->
wined3d_device
,
(
WINED3DMATERIAL
*
)
pMaterial
);
hr
=
wined3d_device_get_material
(
This
->
wined3d_device
,
(
struct
wined3d_material
*
)
pMaterial
);
wined3d_mutex_unlock
();
return
hr
;
...
...
dlls/ddraw/device.c
View file @
02bb70fc
...
...
@@ -5265,8 +5265,8 @@ IDirect3DDeviceImpl_7_SetMaterial(IDirect3DDevice7 *iface,
if
(
!
Mat
)
return
DDERR_INVALIDPARAMS
;
wined3d_mutex_lock
();
/* Note: D3DMATERIAL7 is compatible with
WINED3DMATERIAL
*/
hr
=
wined3d_device_set_material
(
This
->
wined3d_device
,
(
WINED3DMATERIAL
*
)
Mat
);
/* Note: D3DMATERIAL7 is compatible with
struct wined3d_material.
*/
hr
=
wined3d_device_set_material
(
This
->
wined3d_device
,
(
struct
wined3d_material
*
)
Mat
);
wined3d_mutex_unlock
();
return
hr_ddraw_from_wined3d
(
hr
);
...
...
@@ -5319,8 +5319,8 @@ IDirect3DDeviceImpl_7_GetMaterial(IDirect3DDevice7 *iface,
TRACE
(
"iface %p, material %p.
\n
"
,
iface
,
Mat
);
wined3d_mutex_lock
();
/* Note: D3DMATERIAL7 is compatible with
WINED3DMATERIAL
*/
hr
=
wined3d_device_get_material
(
This
->
wined3d_device
,
(
WINED3DMATERIAL
*
)
Mat
);
/* Note: D3DMATERIAL7 is compatible with
struct wined3d_material.
*/
hr
=
wined3d_device_get_material
(
This
->
wined3d_device
,
(
struct
wined3d_material
*
)
Mat
);
wined3d_mutex_unlock
();
return
hr_ddraw_from_wined3d
(
hr
);
...
...
dlls/wined3d/device.c
View file @
02bb70fc
...
...
@@ -2280,7 +2280,7 @@ HRESULT CDECL wined3d_device_get_clip_status(const struct wined3d_device *device
return
WINED3D_OK
;
}
HRESULT
CDECL
wined3d_device_set_material
(
struct
wined3d_device
*
device
,
const
WINED3DMATERIAL
*
material
)
HRESULT
CDECL
wined3d_device_set_material
(
struct
wined3d_device
*
device
,
const
struct
wined3d_material
*
material
)
{
TRACE
(
"device %p, material %p.
\n
"
,
device
,
material
);
...
...
@@ -2299,25 +2299,25 @@ HRESULT CDECL wined3d_device_set_material(struct wined3d_device *device, const W
return
WINED3D_OK
;
}
HRESULT
CDECL
wined3d_device_get_material
(
const
struct
wined3d_device
*
device
,
WINED3DMATERIAL
*
material
)
HRESULT
CDECL
wined3d_device_get_material
(
const
struct
wined3d_device
*
device
,
struct
wined3d_material
*
material
)
{
TRACE
(
"device %p, material %p.
\n
"
,
device
,
material
);
*
material
=
device
->
updateStateBlock
->
state
.
material
;
TRACE
(
"
D
iffuse {%.8e, %.8e, %.8e, %.8e}
\n
"
,
material
->
Diffuse
.
r
,
material
->
D
iffuse
.
g
,
material
->
Diffuse
.
b
,
material
->
D
iffuse
.
a
);
TRACE
(
"
A
mbient {%.8e, %.8e, %.8e, %.8e}
\n
"
,
material
->
Ambient
.
r
,
material
->
A
mbient
.
g
,
material
->
Ambient
.
b
,
material
->
A
mbient
.
a
);
TRACE
(
"
S
pecular {%.8e, %.8e, %.8e, %.8e}
\n
"
,
material
->
Specular
.
r
,
material
->
S
pecular
.
g
,
material
->
Specular
.
b
,
material
->
S
pecular
.
a
);
TRACE
(
"
E
missive {%.8e, %.8e, %.8e, %.8e}
\n
"
,
material
->
Emissive
.
r
,
material
->
E
missive
.
g
,
material
->
Emissive
.
b
,
material
->
E
missive
.
a
);
TRACE
(
"
Power %.8e.
\n
"
,
material
->
P
ower
);
TRACE
(
"
d
iffuse {%.8e, %.8e, %.8e, %.8e}
\n
"
,
material
->
diffuse
.
r
,
material
->
d
iffuse
.
g
,
material
->
diffuse
.
b
,
material
->
d
iffuse
.
a
);
TRACE
(
"
a
mbient {%.8e, %.8e, %.8e, %.8e}
\n
"
,
material
->
ambient
.
r
,
material
->
a
mbient
.
g
,
material
->
ambient
.
b
,
material
->
a
mbient
.
a
);
TRACE
(
"
s
pecular {%.8e, %.8e, %.8e, %.8e}
\n
"
,
material
->
specular
.
r
,
material
->
s
pecular
.
g
,
material
->
specular
.
b
,
material
->
s
pecular
.
a
);
TRACE
(
"
e
missive {%.8e, %.8e, %.8e, %.8e}
\n
"
,
material
->
emissive
.
r
,
material
->
e
missive
.
g
,
material
->
emissive
.
b
,
material
->
e
missive
.
a
);
TRACE
(
"
power %.8e.
\n
"
,
material
->
p
ower
);
return
WINED3D_OK
;
}
...
...
dlls/wined3d/state.c
View file @
02bb70fc
...
...
@@ -656,10 +656,10 @@ static void state_specularenable(struct wined3d_context *context, const struct w
TRACE
(
"Setting specular enable state and materials
\n
"
);
if
(
state
->
render_states
[
WINED3DRS_SPECULARENABLE
])
{
glMaterialfv
(
GL_FRONT_AND_BACK
,
GL_SPECULAR
,
(
float
*
)
&
state
->
material
.
S
pecular
);
glMaterialfv
(
GL_FRONT_AND_BACK
,
GL_SPECULAR
,
(
float
*
)
&
state
->
material
.
s
pecular
);
checkGLcall
(
"glMaterialfv"
);
if
(
state
->
material
.
P
ower
>
gl_info
->
limits
.
shininess
)
if
(
state
->
material
.
p
ower
>
gl_info
->
limits
.
shininess
)
{
/* glMaterialf man page says that the material says that GL_SHININESS must be between 0.0
* and 128.0, although in d3d neither -1 nor 129 produce an error. GL_NV_max_light_exponent
...
...
@@ -667,12 +667,12 @@ static void state_specularenable(struct wined3d_context *context, const struct w
* value reported by the extension, otherwise 128. For values > gl_info->limits.shininess clamp
* them, it should be safe to do so without major visual distortions.
*/
WARN
(
"Material power = %.8e, limit %.8e
\n
"
,
state
->
material
.
P
ower
,
gl_info
->
limits
.
shininess
);
WARN
(
"Material power = %.8e, limit %.8e
\n
"
,
state
->
material
.
p
ower
,
gl_info
->
limits
.
shininess
);
glMaterialf
(
GL_FRONT_AND_BACK
,
GL_SHININESS
,
gl_info
->
limits
.
shininess
);
}
else
{
glMaterialf
(
GL_FRONT_AND_BACK
,
GL_SHININESS
,
state
->
material
.
P
ower
);
glMaterialf
(
GL_FRONT_AND_BACK
,
GL_SHININESS
,
state
->
material
.
p
ower
);
}
checkGLcall
(
"glMaterialf(GL_SHININESS)"
);
...
...
@@ -716,24 +716,24 @@ static void state_specularenable(struct wined3d_context *context, const struct w
}
}
TRACE
(
"
D
iffuse {%.8e, %.8e, %.8e, %.8e}
\n
"
,
state
->
material
.
Diffuse
.
r
,
state
->
material
.
D
iffuse
.
g
,
state
->
material
.
Diffuse
.
b
,
state
->
material
.
D
iffuse
.
a
);
TRACE
(
"
A
mbient {%.8e, %.8e, %.8e, %.8e}
\n
"
,
state
->
material
.
Ambient
.
r
,
state
->
material
.
A
mbient
.
g
,
state
->
material
.
Ambient
.
b
,
state
->
material
.
A
mbient
.
a
);
TRACE
(
"
S
pecular {%.8e, %.8e, %.8e, %.8e}
\n
"
,
state
->
material
.
Specular
.
r
,
state
->
material
.
S
pecular
.
g
,
state
->
material
.
Specular
.
b
,
state
->
material
.
S
pecular
.
a
);
TRACE
(
"
E
missive {%.8e, %.8e, %.8e, %.8e}
\n
"
,
state
->
material
.
Emissive
.
r
,
state
->
material
.
E
missive
.
g
,
state
->
material
.
Emissive
.
b
,
state
->
material
.
E
missive
.
a
);
glMaterialfv
(
GL_FRONT_AND_BACK
,
GL_AMBIENT
,
(
float
*
)
&
state
->
material
.
A
mbient
);
TRACE
(
"
d
iffuse {%.8e, %.8e, %.8e, %.8e}
\n
"
,
state
->
material
.
diffuse
.
r
,
state
->
material
.
d
iffuse
.
g
,
state
->
material
.
diffuse
.
b
,
state
->
material
.
d
iffuse
.
a
);
TRACE
(
"
a
mbient {%.8e, %.8e, %.8e, %.8e}
\n
"
,
state
->
material
.
ambient
.
r
,
state
->
material
.
a
mbient
.
g
,
state
->
material
.
ambient
.
b
,
state
->
material
.
a
mbient
.
a
);
TRACE
(
"
s
pecular {%.8e, %.8e, %.8e, %.8e}
\n
"
,
state
->
material
.
specular
.
r
,
state
->
material
.
s
pecular
.
g
,
state
->
material
.
specular
.
b
,
state
->
material
.
s
pecular
.
a
);
TRACE
(
"
e
missive {%.8e, %.8e, %.8e, %.8e}
\n
"
,
state
->
material
.
emissive
.
r
,
state
->
material
.
e
missive
.
g
,
state
->
material
.
emissive
.
b
,
state
->
material
.
e
missive
.
a
);
glMaterialfv
(
GL_FRONT_AND_BACK
,
GL_AMBIENT
,
(
float
*
)
&
state
->
material
.
a
mbient
);
checkGLcall
(
"glMaterialfv(GL_AMBIENT)"
);
glMaterialfv
(
GL_FRONT_AND_BACK
,
GL_DIFFUSE
,
(
float
*
)
&
state
->
material
.
D
iffuse
);
glMaterialfv
(
GL_FRONT_AND_BACK
,
GL_DIFFUSE
,
(
float
*
)
&
state
->
material
.
d
iffuse
);
checkGLcall
(
"glMaterialfv(GL_DIFFUSE)"
);
glMaterialfv
(
GL_FRONT_AND_BACK
,
GL_EMISSION
,
(
float
*
)
&
state
->
material
.
E
missive
);
glMaterialfv
(
GL_FRONT_AND_BACK
,
GL_EMISSION
,
(
float
*
)
&
state
->
material
.
e
missive
);
checkGLcall
(
"glMaterialfv(GL_EMISSION)"
);
}
...
...
@@ -1272,23 +1272,23 @@ static void state_colormat(struct wined3d_context *context, const struct wined3d
* tracking with glColorMaterial, so apply those here. */
switch
(
context
->
tracking_parm
)
{
case
GL_AMBIENT_AND_DIFFUSE
:
glMaterialfv
(
GL_FRONT_AND_BACK
,
GL_AMBIENT
,
(
float
*
)
&
state
->
material
.
A
mbient
);
glMaterialfv
(
GL_FRONT_AND_BACK
,
GL_DIFFUSE
,
(
float
*
)
&
state
->
material
.
D
iffuse
);
glMaterialfv
(
GL_FRONT_AND_BACK
,
GL_AMBIENT
,
(
float
*
)
&
state
->
material
.
a
mbient
);
glMaterialfv
(
GL_FRONT_AND_BACK
,
GL_DIFFUSE
,
(
float
*
)
&
state
->
material
.
d
iffuse
);
checkGLcall
(
"glMaterialfv"
);
break
;
case
GL_DIFFUSE
:
glMaterialfv
(
GL_FRONT_AND_BACK
,
GL_DIFFUSE
,
(
float
*
)
&
state
->
material
.
D
iffuse
);
glMaterialfv
(
GL_FRONT_AND_BACK
,
GL_DIFFUSE
,
(
float
*
)
&
state
->
material
.
d
iffuse
);
checkGLcall
(
"glMaterialfv"
);
break
;
case
GL_AMBIENT
:
glMaterialfv
(
GL_FRONT_AND_BACK
,
GL_AMBIENT
,
(
float
*
)
&
state
->
material
.
A
mbient
);
glMaterialfv
(
GL_FRONT_AND_BACK
,
GL_AMBIENT
,
(
float
*
)
&
state
->
material
.
a
mbient
);
checkGLcall
(
"glMaterialfv"
);
break
;
case
GL_EMISSION
:
glMaterialfv
(
GL_FRONT_AND_BACK
,
GL_EMISSION
,
(
float
*
)
&
state
->
material
.
E
missive
);
glMaterialfv
(
GL_FRONT_AND_BACK
,
GL_EMISSION
,
(
float
*
)
&
state
->
material
.
e
missive
);
checkGLcall
(
"glMaterialfv"
);
break
;
...
...
@@ -1296,9 +1296,11 @@ static void state_colormat(struct wined3d_context *context, const struct wined3d
/* Only change material color if specular is enabled, otherwise it is set to black */
if
(
state
->
render_states
[
WINED3DRS_SPECULARENABLE
])
{
glMaterialfv
(
GL_FRONT_AND_BACK
,
GL_SPECULAR
,
(
float
*
)
&
state
->
material
.
S
pecular
);
glMaterialfv
(
GL_FRONT_AND_BACK
,
GL_SPECULAR
,
(
float
*
)
&
state
->
material
.
s
pecular
);
checkGLcall
(
"glMaterialfv"
);
}
else
{
}
else
{
static
const
GLfloat
black
[]
=
{
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
};
glMaterialfv
(
GL_FRONT_AND_BACK
,
GL_SPECULAR
,
&
black
[
0
]);
checkGLcall
(
"glMaterialfv"
);
...
...
dlls/wined3d/wined3d_private.h
View file @
02bb70fc
...
...
@@ -2279,7 +2279,7 @@ struct wined3d_state
struct
wined3d_matrix
transforms
[
HIGHEST_TRANSFORMSTATE
+
1
];
double
clip_planes
[
MAX_CLIPPLANES
][
4
];
WINED3DMATERIAL
material
;
struct
wined3d_material
material
;
WINED3DVIEWPORT
viewport
;
RECT
scissor_rect
;
...
...
include/wine/wined3d.h
View file @
02bb70fc
...
...
@@ -1564,14 +1564,14 @@ struct wined3d_light
float
phi
;
};
typedef
struct
_WINED3DMATERIAL
struct
wined3d_material
{
struct
wined3d_color
D
iffuse
;
struct
wined3d_color
A
mbient
;
struct
wined3d_color
S
pecular
;
struct
wined3d_color
E
missive
;
float
P
ower
;
}
WINED3DMATERIAL
;
struct
wined3d_color
d
iffuse
;
struct
wined3d_color
a
mbient
;
struct
wined3d_color
s
pecular
;
struct
wined3d_color
e
missive
;
float
p
ower
;
};
typedef
struct
_WINED3DVIEWPORT
{
...
...
@@ -2217,7 +2217,7 @@ HRESULT __cdecl wined3d_device_get_index_buffer(const struct wined3d_device *dev
HRESULT
__cdecl
wined3d_device_get_light
(
const
struct
wined3d_device
*
device
,
UINT
light_idx
,
struct
wined3d_light
*
light
);
HRESULT
__cdecl
wined3d_device_get_light_enable
(
const
struct
wined3d_device
*
device
,
UINT
light_idx
,
BOOL
*
enable
);
HRESULT
__cdecl
wined3d_device_get_material
(
const
struct
wined3d_device
*
device
,
WINED3DMATERIAL
*
material
);
HRESULT
__cdecl
wined3d_device_get_material
(
const
struct
wined3d_device
*
device
,
struct
wined3d_material
*
material
);
float
__cdecl
wined3d_device_get_npatch_mode
(
const
struct
wined3d_device
*
device
);
struct
wined3d_shader
*
__cdecl
wined3d_device_get_pixel_shader
(
const
struct
wined3d_device
*
device
);
void
__cdecl
wined3d_device_get_primitive_type
(
const
struct
wined3d_device
*
device
,
...
...
@@ -2296,7 +2296,7 @@ HRESULT __cdecl wined3d_device_set_index_buffer(struct wined3d_device *device,
HRESULT
__cdecl
wined3d_device_set_light
(
struct
wined3d_device
*
device
,
UINT
light_idx
,
const
struct
wined3d_light
*
light
);
HRESULT
__cdecl
wined3d_device_set_light_enable
(
struct
wined3d_device
*
device
,
UINT
light_idx
,
BOOL
enable
);
HRESULT
__cdecl
wined3d_device_set_material
(
struct
wined3d_device
*
device
,
const
WINED3DMATERIAL
*
material
);
HRESULT
__cdecl
wined3d_device_set_material
(
struct
wined3d_device
*
device
,
const
struct
wined3d_material
*
material
);
void
__cdecl
wined3d_device_set_multithreaded
(
struct
wined3d_device
*
device
);
HRESULT
__cdecl
wined3d_device_set_npatch_mode
(
struct
wined3d_device
*
device
,
float
segments
);
HRESULT
__cdecl
wined3d_device_set_pixel_shader
(
struct
wined3d_device
*
device
,
struct
wined3d_shader
*
shader
);
...
...
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