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
be8917cd
Commit
be8917cd
authored
Nov 21, 2011
by
Henri Verbeet
Committed by
Alexandre Julliard
Nov 22, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Get rid of the WINED3DVIEWPORT typedef.
parent
14cf780f
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
71 additions
and
71 deletions
+71
-71
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
+21
-21
state.c
dlls/wined3d/state.c
+17
-17
stateblock.c
dlls/wined3d/stateblock.c
+6
-6
utils.c
dlls/wined3d/utils.c
+2
-2
wined3d_private.h
dlls/wined3d/wined3d_private.h
+3
-3
wined3d.h
include/wine/wined3d.h
+10
-10
No files found.
dlls/d3d8/device.c
View file @
be8917cd
...
...
@@ -1279,9 +1279,9 @@ static HRESULT WINAPI IDirect3DDevice8Impl_SetViewport(IDirect3DDevice8 *iface,
TRACE
(
"iface %p, viewport %p.
\n
"
,
iface
,
pViewport
);
/* Note: D3DVIEWPORT8 is compatible with
WINED3DVIEWPORT
*/
/* Note: D3DVIEWPORT8 is compatible with
struct wined3d_viewport.
*/
wined3d_mutex_lock
();
hr
=
wined3d_device_set_viewport
(
This
->
wined3d_device
,
(
const
WINED3DVIEWPORT
*
)
pViewport
);
hr
=
wined3d_device_set_viewport
(
This
->
wined3d_device
,
(
const
struct
wined3d_viewport
*
)
pViewport
);
wined3d_mutex_unlock
();
return
hr
;
...
...
@@ -1295,9 +1295,9 @@ static HRESULT WINAPI IDirect3DDevice8Impl_GetViewport(IDirect3DDevice8 *iface,
TRACE
(
"iface %p, viewport %p.
\n
"
,
iface
,
pViewport
);
/* Note: D3DVIEWPORT8 is compatible with
WINED3DVIEWPORT
*/
/* Note: D3DVIEWPORT8 is compatible with
struct wined3d_viewport.
*/
wined3d_mutex_lock
();
hr
=
wined3d_device_get_viewport
(
This
->
wined3d_device
,
(
WINED3DVIEWPORT
*
)
pViewport
);
hr
=
wined3d_device_get_viewport
(
This
->
wined3d_device
,
(
struct
wined3d_viewport
*
)
pViewport
);
wined3d_mutex_unlock
();
return
hr
;
...
...
dlls/d3d9/device.c
View file @
be8917cd
...
...
@@ -1297,9 +1297,9 @@ static HRESULT WINAPI IDirect3DDevice9Impl_SetViewport(IDirect3DDevice9Ex *iface
TRACE
(
"iface %p, viewport %p.
\n
"
,
iface
,
pViewport
);
/* Note: D3DVIEWPORT9 is compatible with
WINED3DVIEWPORT
*/
/* Note: D3DVIEWPORT9 is compatible with
struct wined3d_viewport.
*/
wined3d_mutex_lock
();
hr
=
wined3d_device_set_viewport
(
This
->
wined3d_device
,
(
const
WINED3DVIEWPORT
*
)
pViewport
);
hr
=
wined3d_device_set_viewport
(
This
->
wined3d_device
,
(
const
struct
wined3d_viewport
*
)
pViewport
);
wined3d_mutex_unlock
();
return
hr
;
...
...
@@ -1313,9 +1313,9 @@ static HRESULT WINAPI IDirect3DDevice9Impl_GetViewport(IDirect3DDevice9Ex *iface
TRACE
(
"iface %p, viewport %p.
\n
"
,
iface
,
pViewport
);
/* Note: D3DVIEWPORT9 is compatible with
WINED3DVIEWPORT
*/
/* Note: D3DVIEWPORT9 is compatible with
struct wined3d_viewport.
*/
wined3d_mutex_lock
();
hr
=
wined3d_device_get_viewport
(
This
->
wined3d_device
,
(
WINED3DVIEWPORT
*
)
pViewport
);
hr
=
wined3d_device_get_viewport
(
This
->
wined3d_device
,
(
struct
wined3d_viewport
*
)
pViewport
);
wined3d_mutex_unlock
();
return
hr
;
...
...
dlls/ddraw/device.c
View file @
be8917cd
...
...
@@ -5151,9 +5151,9 @@ IDirect3DDeviceImpl_7_SetViewport(IDirect3DDevice7 *iface,
if
(
!
Data
)
return
DDERR_INVALIDPARAMS
;
/* Note: D3DVIEWPORT7 is compatible with
WINED3DVIEWPORT
*/
/* Note: D3DVIEWPORT7 is compatible with
struct wined3d_viewport.
*/
wined3d_mutex_lock
();
hr
=
wined3d_device_set_viewport
(
This
->
wined3d_device
,
(
WINED3DVIEWPORT
*
)
Data
);
hr
=
wined3d_device_set_viewport
(
This
->
wined3d_device
,
(
struct
wined3d_viewport
*
)
Data
);
wined3d_mutex_unlock
();
return
hr
;
...
...
@@ -5208,9 +5208,9 @@ IDirect3DDeviceImpl_7_GetViewport(IDirect3DDevice7 *iface,
if
(
!
Data
)
return
DDERR_INVALIDPARAMS
;
/* Note: D3DVIEWPORT7 is compatible with
WINED3DVIEWPORT
*/
/* Note: D3DVIEWPORT7 is compatible with
struct wined3d_viewport.
*/
wined3d_mutex_lock
();
hr
=
wined3d_device_get_viewport
(
This
->
wined3d_device
,
(
WINED3DVIEWPORT
*
)
Data
);
hr
=
wined3d_device_get_viewport
(
This
->
wined3d_device
,
(
struct
wined3d_viewport
*
)
Data
);
wined3d_mutex_unlock
();
return
hr_ddraw_from_wined3d
(
hr
);
...
...
dlls/wined3d/device.c
View file @
be8917cd
...
...
@@ -2407,11 +2407,11 @@ INT CDECL wined3d_device_get_base_vertex_index(const struct wined3d_device *devi
return
device
->
stateBlock
->
state
.
base_vertex_index
;
}
HRESULT
CDECL
wined3d_device_set_viewport
(
struct
wined3d_device
*
device
,
const
WINED3DVIEWPORT
*
viewport
)
HRESULT
CDECL
wined3d_device_set_viewport
(
struct
wined3d_device
*
device
,
const
struct
wined3d_viewport
*
viewport
)
{
TRACE
(
"device %p, viewport %p.
\n
"
,
device
,
viewport
);
TRACE
(
"x %u, y %u, w %u, h %u, min
z %.8e, max
z %.8e.
\n
"
,
viewport
->
X
,
viewport
->
Y
,
viewport
->
Width
,
viewport
->
Height
,
viewport
->
MinZ
,
viewport
->
MaxZ
);
TRACE
(
"x %u, y %u, w %u, h %u, min
_z %.8e, max_
z %.8e.
\n
"
,
viewport
->
x
,
viewport
->
y
,
viewport
->
width
,
viewport
->
height
,
viewport
->
min_z
,
viewport
->
max_z
);
device
->
updateStateBlock
->
changed
.
viewport
=
TRUE
;
device
->
updateStateBlock
->
state
.
viewport
=
*
viewport
;
...
...
@@ -2428,7 +2428,7 @@ HRESULT CDECL wined3d_device_set_viewport(struct wined3d_device *device, const W
return
WINED3D_OK
;
}
HRESULT
CDECL
wined3d_device_get_viewport
(
const
struct
wined3d_device
*
device
,
WINED3DVIEWPORT
*
viewport
)
HRESULT
CDECL
wined3d_device_get_viewport
(
const
struct
wined3d_device
*
device
,
struct
wined3d_viewport
*
viewport
)
{
TRACE
(
"device %p, viewport %p.
\n
"
,
device
,
viewport
);
...
...
@@ -3202,8 +3202,8 @@ static HRESULT process_vertices_strided(const struct wined3d_device *device, DWO
const
struct
wined3d_gl_info
*
gl_info
=
&
device
->
adapter
->
gl_info
;
char
*
dest_ptr
,
*
dest_conv
=
NULL
,
*
dest_conv_addr
=
NULL
;
struct
wined3d_matrix
mat
,
proj_mat
,
view_mat
,
world_mat
;
struct
wined3d_viewport
vp
;
unsigned
int
i
;
WINED3DVIEWPORT
vp
;
BOOL
doClip
;
DWORD
numTextures
;
...
...
@@ -3289,8 +3289,8 @@ static HRESULT process_vertices_strided(const struct wined3d_device *device, DWO
/* Get the viewport */
wined3d_device_get_viewport
(
device
,
&
vp
);
TRACE
(
"
Viewport: X=%d, Y=%d, Width=%d, Height=%d, MinZ=%f, MaxZ=%f
\n
"
,
vp
.
X
,
vp
.
Y
,
vp
.
Width
,
vp
.
Height
,
vp
.
MinZ
,
vp
.
MaxZ
);
TRACE
(
"
viewport x %u, y %u, width %u, height %u, min_z %.8e, max_z %.8e.
\n
"
,
vp
.
x
,
vp
.
y
,
vp
.
width
,
vp
.
height
,
vp
.
min_z
,
vp
.
max_z
);
multiply_matrix
(
&
mat
,
&
view_mat
,
&
world_mat
);
multiply_matrix
(
&
mat
,
&
proj_mat
,
&
mat
);
...
...
@@ -3359,13 +3359,13 @@ static HRESULT process_vertices_strided(const struct wined3d_device *device, DWO
y
*=
-
1
;
x
*=
vp
.
W
idth
/
2
;
y
*=
vp
.
H
eight
/
2
;
z
*=
vp
.
MaxZ
-
vp
.
MinZ
;
x
*=
vp
.
w
idth
/
2
;
y
*=
vp
.
h
eight
/
2
;
z
*=
vp
.
max_z
-
vp
.
min_z
;
x
+=
vp
.
Width
/
2
+
vp
.
X
;
y
+=
vp
.
Height
/
2
+
vp
.
Y
;
z
+=
vp
.
MinZ
;
x
+=
vp
.
width
/
2
+
vp
.
x
;
y
+=
vp
.
height
/
2
+
vp
.
y
;
z
+=
vp
.
min_z
;
rhw
=
1
/
rhw
;
}
else
{
...
...
@@ -4912,18 +4912,18 @@ HRESULT CDECL wined3d_device_set_render_target(struct wined3d_device *device,
/* Set the viewport and scissor rectangles, if requested. Tests show
* that stateblock recording is ignored, the change goes directly
* into the primary stateblock. */
device
->
stateBlock
->
state
.
viewport
.
H
eight
=
device
->
fb
.
render_targets
[
0
]
->
resource
.
height
;
device
->
stateBlock
->
state
.
viewport
.
W
idth
=
device
->
fb
.
render_targets
[
0
]
->
resource
.
width
;
device
->
stateBlock
->
state
.
viewport
.
X
=
0
;
device
->
stateBlock
->
state
.
viewport
.
Y
=
0
;
device
->
stateBlock
->
state
.
viewport
.
MaxZ
=
1
.
0
f
;
device
->
stateBlock
->
state
.
viewport
.
MinZ
=
0
.
0
f
;
device
->
stateBlock
->
state
.
viewport
.
h
eight
=
device
->
fb
.
render_targets
[
0
]
->
resource
.
height
;
device
->
stateBlock
->
state
.
viewport
.
w
idth
=
device
->
fb
.
render_targets
[
0
]
->
resource
.
width
;
device
->
stateBlock
->
state
.
viewport
.
x
=
0
;
device
->
stateBlock
->
state
.
viewport
.
y
=
0
;
device
->
stateBlock
->
state
.
viewport
.
max_z
=
1
.
0
f
;
device
->
stateBlock
->
state
.
viewport
.
min_z
=
0
.
0
f
;
device_invalidate_state
(
device
,
STATE_VIEWPORT
);
device
->
stateBlock
->
state
.
scissor_rect
.
top
=
0
;
device
->
stateBlock
->
state
.
scissor_rect
.
left
=
0
;
device
->
stateBlock
->
state
.
scissor_rect
.
right
=
device
->
stateBlock
->
state
.
viewport
.
W
idth
;
device
->
stateBlock
->
state
.
scissor_rect
.
bottom
=
device
->
stateBlock
->
state
.
viewport
.
H
eight
;
device
->
stateBlock
->
state
.
scissor_rect
.
right
=
device
->
stateBlock
->
state
.
viewport
.
w
idth
;
device
->
stateBlock
->
state
.
scissor_rect
.
bottom
=
device
->
stateBlock
->
state
.
viewport
.
h
eight
;
device_invalidate_state
(
device
,
STATE_SCISSORRECT
);
}
...
...
dlls/wined3d/state.c
View file @
be8917cd
...
...
@@ -1444,8 +1444,8 @@ static void state_pscale(struct wined3d_context *context, const struct wined3d_s
if
(
state
->
render_states
[
WINED3DRS_POINTSCALEENABLE
])
{
DWORD
h
=
state
->
viewport
.
height
;
GLfloat
scaleFactor
;
DWORD
h
=
state
->
viewport
.
Height
;
if
(
pointSize
.
f
<
gl_info
->
limits
.
pointsize_min
)
{
...
...
@@ -3909,10 +3909,10 @@ static void transform_projection(struct wined3d_context *context, const struct w
if
(
context
->
last_was_rhw
)
{
/* Transform D3D RHW coordinates to OpenGL clip coordinates. */
double
x
=
state
->
viewport
.
X
;
double
y
=
state
->
viewport
.
Y
;
double
w
=
state
->
viewport
.
W
idth
;
double
h
=
state
->
viewport
.
H
eight
;
double
x
=
state
->
viewport
.
x
;
double
y
=
state
->
viewport
.
y
;
double
w
=
state
->
viewport
.
w
idth
;
double
h
=
state
->
viewport
.
h
eight
;
double
x_scale
=
2
.
0
/
w
;
double
x_offset
=
((
63
.
0
/
64
.
0
)
-
(
2
.
0
*
x
)
-
w
)
/
w
;
double
y_scale
=
context
->
render_offscreen
?
2
.
0
/
h
:
2
.
0
/
-
h
;
...
...
@@ -3933,10 +3933,10 @@ static void transform_projection(struct wined3d_context *context, const struct w
else
{
double
y_scale
=
context
->
render_offscreen
?
-
1
.
0
:
1
.
0
;
double
x_offset
=
(
63
.
0
/
64
.
0
)
/
state
->
viewport
.
W
idth
;
double
x_offset
=
(
63
.
0
/
64
.
0
)
/
state
->
viewport
.
w
idth
;
double
y_offset
=
context
->
render_offscreen
?
(
63
.
0
/
64
.
0
)
/
state
->
viewport
.
H
eight
:
-
(
63
.
0
/
64
.
0
)
/
state
->
viewport
.
H
eight
;
?
(
63
.
0
/
64
.
0
)
/
state
->
viewport
.
h
eight
:
-
(
63
.
0
/
64
.
0
)
/
state
->
viewport
.
h
eight
;
const
GLdouble
projection
[]
=
{
1
.
0
,
0
.
0
,
0
.
0
,
0
.
0
,
...
...
@@ -4590,28 +4590,28 @@ static void vertexdeclaration(struct wined3d_context *context, const struct wine
static
void
viewport_miscpart
(
struct
wined3d_context
*
context
,
const
struct
wined3d_state
*
state
,
DWORD
state_id
)
{
const
struct
wined3d_surface
*
target
=
state
->
fb
->
render_targets
[
0
];
WINED3DVIEWPORT
vp
=
state
->
viewport
;
struct
wined3d_viewport
vp
=
state
->
viewport
;
if
(
vp
.
W
idth
>
target
->
resource
.
width
)
vp
.
W
idth
=
target
->
resource
.
width
;
if
(
vp
.
H
eight
>
target
->
resource
.
height
)
vp
.
H
eight
=
target
->
resource
.
height
;
if
(
vp
.
w
idth
>
target
->
resource
.
width
)
vp
.
w
idth
=
target
->
resource
.
width
;
if
(
vp
.
h
eight
>
target
->
resource
.
height
)
vp
.
h
eight
=
target
->
resource
.
height
;
glDepthRange
(
vp
.
MinZ
,
vp
.
MaxZ
);
glDepthRange
(
vp
.
min_z
,
vp
.
max_z
);
checkGLcall
(
"glDepthRange"
);
/* Note: GL requires lower left, DirectX supplies upper left. This is
* reversed when using offscreen rendering. */
if
(
context
->
render_offscreen
)
{
glViewport
(
vp
.
X
,
vp
.
Y
,
vp
.
Width
,
vp
.
H
eight
);
glViewport
(
vp
.
x
,
vp
.
y
,
vp
.
width
,
vp
.
h
eight
);
}
else
{
UINT
width
,
height
;
target
->
get_drawable_size
(
context
,
&
width
,
&
height
);
glViewport
(
vp
.
X
,
(
height
-
(
vp
.
Y
+
vp
.
H
eight
)),
vp
.
Width
,
vp
.
H
eight
);
glViewport
(
vp
.
x
,
(
height
-
(
vp
.
y
+
vp
.
h
eight
)),
vp
.
width
,
vp
.
h
eight
);
}
checkGLcall
(
"glViewport"
);
...
...
dlls/wined3d/stateblock.c
View file @
be8917cd
...
...
@@ -1304,12 +1304,12 @@ void stateblock_init_default_state(struct wined3d_stateblock *stateblock)
}
/* Set the default viewport */
state
->
viewport
.
X
=
0
;
state
->
viewport
.
Y
=
0
;
state
->
viewport
.
W
idth
=
swapchain
->
presentParms
.
BackBufferWidth
;
state
->
viewport
.
H
eight
=
swapchain
->
presentParms
.
BackBufferHeight
;
state
->
viewport
.
MinZ
=
0
.
0
f
;
state
->
viewport
.
MaxZ
=
1
.
0
f
;
state
->
viewport
.
x
=
0
;
state
->
viewport
.
y
=
0
;
state
->
viewport
.
w
idth
=
swapchain
->
presentParms
.
BackBufferWidth
;
state
->
viewport
.
h
eight
=
swapchain
->
presentParms
.
BackBufferHeight
;
state
->
viewport
.
min_z
=
0
.
0
f
;
state
->
viewport
.
max_z
=
1
.
0
f
;
wined3d_swapchain_decref
(
swapchain
);
}
...
...
dlls/wined3d/utils.c
View file @
be8917cd
...
...
@@ -3374,9 +3374,9 @@ const struct blit_shader *wined3d_select_blitter(const struct wined3d_gl_info *g
void
wined3d_get_draw_rect
(
const
struct
wined3d_state
*
state
,
RECT
*
rect
)
{
const
WINED3DVIEWPORT
*
vp
=
&
state
->
viewport
;
const
struct
wined3d_viewport
*
vp
=
&
state
->
viewport
;
SetRect
(
rect
,
vp
->
X
,
vp
->
Y
,
vp
->
X
+
vp
->
Width
,
vp
->
Y
+
vp
->
H
eight
);
SetRect
(
rect
,
vp
->
x
,
vp
->
y
,
vp
->
x
+
vp
->
width
,
vp
->
y
+
vp
->
h
eight
);
if
(
state
->
render_states
[
WINED3DRS_SCISSORTESTENABLE
])
IntersectRect
(
rect
,
rect
,
&
state
->
scissor_rect
);
...
...
dlls/wined3d/wined3d_private.h
View file @
be8917cd
...
...
@@ -2283,7 +2283,7 @@ struct wined3d_state
struct
wined3d_matrix
transforms
[
HIGHEST_TRANSFORMSTATE
+
1
];
double
clip_planes
[
MAX_CLIPPLANES
][
4
];
struct
wined3d_material
material
;
WINED3DVIEWPORT
viewport
;
struct
wined3d_viewport
viewport
;
RECT
scissor_rect
;
/* Light hashmap . Collisions are handled using standard wine double linked lists */
...
...
@@ -2699,8 +2699,8 @@ static inline void shader_get_position_fixup(const struct wined3d_context *conte
{
position_fixup
[
0
]
=
1
.
0
f
;
position_fixup
[
1
]
=
1
.
0
f
;
position_fixup
[
2
]
=
(
63
.
0
f
/
64
.
0
f
)
/
state
->
viewport
.
W
idth
;
position_fixup
[
3
]
=
-
(
63
.
0
f
/
64
.
0
f
)
/
state
->
viewport
.
H
eight
;
position_fixup
[
2
]
=
(
63
.
0
f
/
64
.
0
f
)
/
state
->
viewport
.
w
idth
;
position_fixup
[
3
]
=
-
(
63
.
0
f
/
64
.
0
f
)
/
state
->
viewport
.
h
eight
;
if
(
context
->
render_offscreen
)
{
...
...
include/wine/wined3d.h
View file @
be8917cd
...
...
@@ -1573,15 +1573,15 @@ struct wined3d_material
float
power
;
};
typedef
struct
_WINED3DVIEWPORT
struct
wined3d_viewport
{
DWORD
X
;
DWORD
Y
;
DWORD
W
idth
;
DWORD
H
eight
;
float
MinZ
;
float
MaxZ
;
}
WINED3DVIEWPORT
;
UINT
x
;
UINT
y
;
UINT
w
idth
;
UINT
h
eight
;
float
min_z
;
float
max_z
;
};
typedef
struct
_WINED3DGAMMARAMP
{
...
...
@@ -2256,7 +2256,7 @@ HRESULT __cdecl wined3d_device_get_transform(const struct wined3d_device *device
HRESULT
__cdecl
wined3d_device_get_vertex_declaration
(
const
struct
wined3d_device
*
device
,
struct
wined3d_vertex_declaration
**
declaration
);
struct
wined3d_shader
*
__cdecl
wined3d_device_get_vertex_shader
(
const
struct
wined3d_device
*
device
);
HRESULT
__cdecl
wined3d_device_get_viewport
(
const
struct
wined3d_device
*
device
,
WINED3DVIEWPORT
*
viewport
);
HRESULT
__cdecl
wined3d_device_get_viewport
(
const
struct
wined3d_device
*
device
,
struct
wined3d_viewport
*
viewport
);
HRESULT
__cdecl
wined3d_device_get_vs_consts_b
(
const
struct
wined3d_device
*
device
,
UINT
start_register
,
BOOL
*
constants
,
UINT
bool_count
);
HRESULT
__cdecl
wined3d_device_get_vs_consts_f
(
const
struct
wined3d_device
*
device
,
...
...
@@ -2326,7 +2326,7 @@ HRESULT __cdecl wined3d_device_set_transform(struct wined3d_device *device,
HRESULT
__cdecl
wined3d_device_set_vertex_declaration
(
struct
wined3d_device
*
device
,
struct
wined3d_vertex_declaration
*
declaration
);
HRESULT
__cdecl
wined3d_device_set_vertex_shader
(
struct
wined3d_device
*
device
,
struct
wined3d_shader
*
shader
);
HRESULT
__cdecl
wined3d_device_set_viewport
(
struct
wined3d_device
*
device
,
const
WINED3DVIEWPORT
*
viewport
);
HRESULT
__cdecl
wined3d_device_set_viewport
(
struct
wined3d_device
*
device
,
const
struct
wined3d_viewport
*
viewport
);
HRESULT
__cdecl
wined3d_device_set_vs_consts_b
(
struct
wined3d_device
*
device
,
UINT
start_register
,
const
BOOL
*
constants
,
UINT
bool_count
);
HRESULT
__cdecl
wined3d_device_set_vs_consts_f
(
struct
wined3d_device
*
device
,
...
...
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