Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
8a96a8cc
Commit
8a96a8cc
authored
Oct 19, 2010
by
Henri Verbeet
Committed by
Alexandre Julliard
Oct 19, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Always pass a valid rectangle to surface_get_blt_info().
parent
ca381b61
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
31 deletions
+22
-31
surface.c
dlls/wined3d/surface.c
+22
-31
No files found.
dlls/wined3d/surface.c
View file @
8a96a8cc
...
...
@@ -149,22 +149,11 @@ static inline void cube_coords_float(const RECT *r, UINT w, UINT h, struct float
f
->
b
=
((
r
->
bottom
*
2
.
0
f
)
/
h
)
-
1
.
0
f
;
}
static
void
surface_get_blt_info
(
GLenum
target
,
const
RECT
*
rect
_in
,
GLsizei
w
,
GLsizei
h
,
struct
blt_info
*
info
)
static
void
surface_get_blt_info
(
GLenum
target
,
const
RECT
*
rect
,
GLsizei
w
,
GLsizei
h
,
struct
blt_info
*
info
)
{
GLfloat
(
*
coords
)[
3
]
=
info
->
coords
;
RECT
rect
;
struct
float_rect
f
;
if
(
rect_in
)
rect
=
*
rect_in
;
else
{
rect
.
left
=
0
;
rect
.
top
=
h
;
rect
.
right
=
w
;
rect
.
bottom
=
0
;
}
switch
(
target
)
{
default:
...
...
@@ -174,20 +163,20 @@ static void surface_get_blt_info(GLenum target, const RECT *rect_in, GLsizei w,
info
->
binding
=
GL_TEXTURE_BINDING_2D
;
info
->
bind_target
=
GL_TEXTURE_2D
;
info
->
tex_type
=
tex_2d
;
coords
[
0
][
0
]
=
(
float
)
rect
.
left
/
w
;
coords
[
0
][
1
]
=
(
float
)
rect
.
top
/
h
;
coords
[
0
][
0
]
=
(
float
)
rect
->
left
/
w
;
coords
[
0
][
1
]
=
(
float
)
rect
->
top
/
h
;
coords
[
0
][
2
]
=
0
.
0
f
;
coords
[
1
][
0
]
=
(
float
)
rect
.
right
/
w
;
coords
[
1
][
1
]
=
(
float
)
rect
.
top
/
h
;
coords
[
1
][
0
]
=
(
float
)
rect
->
right
/
w
;
coords
[
1
][
1
]
=
(
float
)
rect
->
top
/
h
;
coords
[
1
][
2
]
=
0
.
0
f
;
coords
[
2
][
0
]
=
(
float
)
rect
.
left
/
w
;
coords
[
2
][
1
]
=
(
float
)
rect
.
bottom
/
h
;
coords
[
2
][
0
]
=
(
float
)
rect
->
left
/
w
;
coords
[
2
][
1
]
=
(
float
)
rect
->
bottom
/
h
;
coords
[
2
][
2
]
=
0
.
0
f
;
coords
[
3
][
0
]
=
(
float
)
rect
.
right
/
w
;
coords
[
3
][
1
]
=
(
float
)
rect
.
bottom
/
h
;
coords
[
3
][
0
]
=
(
float
)
rect
->
right
/
w
;
coords
[
3
][
1
]
=
(
float
)
rect
->
bottom
/
h
;
coords
[
3
][
2
]
=
0
.
0
f
;
break
;
...
...
@@ -195,17 +184,17 @@ static void surface_get_blt_info(GLenum target, const RECT *rect_in, GLsizei w,
info
->
binding
=
GL_TEXTURE_BINDING_RECTANGLE_ARB
;
info
->
bind_target
=
GL_TEXTURE_RECTANGLE_ARB
;
info
->
tex_type
=
tex_rect
;
coords
[
0
][
0
]
=
rect
.
left
;
coords
[
0
][
1
]
=
rect
.
top
;
coords
[
0
][
2
]
=
0
.
0
f
;
coords
[
1
][
0
]
=
rect
.
right
;
coords
[
1
][
1
]
=
rect
.
top
;
coords
[
1
][
2
]
=
0
.
0
f
;
coords
[
2
][
0
]
=
rect
.
left
;
coords
[
2
][
1
]
=
rect
.
bottom
;
coords
[
2
][
2
]
=
0
.
0
f
;
coords
[
3
][
0
]
=
rect
.
right
;
coords
[
3
][
1
]
=
rect
.
bottom
;
coords
[
3
][
2
]
=
0
.
0
f
;
coords
[
0
][
0
]
=
rect
->
left
;
coords
[
0
][
1
]
=
rect
->
top
;
coords
[
0
][
2
]
=
0
.
0
f
;
coords
[
1
][
0
]
=
rect
->
right
;
coords
[
1
][
1
]
=
rect
->
top
;
coords
[
1
][
2
]
=
0
.
0
f
;
coords
[
2
][
0
]
=
rect
->
left
;
coords
[
2
][
1
]
=
rect
->
bottom
;
coords
[
2
][
2
]
=
0
.
0
f
;
coords
[
3
][
0
]
=
rect
->
right
;
coords
[
3
][
1
]
=
rect
->
bottom
;
coords
[
3
][
2
]
=
0
.
0
f
;
break
;
case
GL_TEXTURE_CUBE_MAP_POSITIVE_X
:
info
->
binding
=
GL_TEXTURE_BINDING_CUBE_MAP_ARB
;
info
->
bind_target
=
GL_TEXTURE_CUBE_MAP_ARB
;
info
->
tex_type
=
tex_cube
;
cube_coords_float
(
&
rect
,
w
,
h
,
&
f
);
cube_coords_float
(
rect
,
w
,
h
,
&
f
);
coords
[
0
][
0
]
=
1
.
0
f
;
coords
[
0
][
1
]
=
-
f
.
t
;
coords
[
0
][
2
]
=
-
f
.
l
;
coords
[
1
][
0
]
=
1
.
0
f
;
coords
[
1
][
1
]
=
-
f
.
t
;
coords
[
1
][
2
]
=
-
f
.
r
;
...
...
@@ -217,7 +206,7 @@ static void surface_get_blt_info(GLenum target, const RECT *rect_in, GLsizei w,
info
->
binding
=
GL_TEXTURE_BINDING_CUBE_MAP_ARB
;
info
->
bind_target
=
GL_TEXTURE_CUBE_MAP_ARB
;
info
->
tex_type
=
tex_cube
;
cube_coords_float
(
&
rect
,
w
,
h
,
&
f
);
cube_coords_float
(
rect
,
w
,
h
,
&
f
);
coords
[
0
][
0
]
=
-
1
.
0
f
;
coords
[
0
][
1
]
=
-
f
.
t
;
coords
[
0
][
2
]
=
f
.
l
;
coords
[
1
][
0
]
=
-
1
.
0
f
;
coords
[
1
][
1
]
=
-
f
.
t
;
coords
[
1
][
2
]
=
f
.
r
;
...
...
@@ -229,7 +218,7 @@ static void surface_get_blt_info(GLenum target, const RECT *rect_in, GLsizei w,
info
->
binding
=
GL_TEXTURE_BINDING_CUBE_MAP_ARB
;
info
->
bind_target
=
GL_TEXTURE_CUBE_MAP_ARB
;
info
->
tex_type
=
tex_cube
;
cube_coords_float
(
&
rect
,
w
,
h
,
&
f
);
cube_coords_float
(
rect
,
w
,
h
,
&
f
);
coords
[
0
][
0
]
=
f
.
l
;
coords
[
0
][
1
]
=
1
.
0
f
;
coords
[
0
][
2
]
=
f
.
t
;
coords
[
1
][
0
]
=
f
.
r
;
coords
[
1
][
1
]
=
1
.
0
f
;
coords
[
1
][
2
]
=
f
.
t
;
...
...
@@ -241,7 +230,7 @@ static void surface_get_blt_info(GLenum target, const RECT *rect_in, GLsizei w,
info
->
binding
=
GL_TEXTURE_BINDING_CUBE_MAP_ARB
;
info
->
bind_target
=
GL_TEXTURE_CUBE_MAP_ARB
;
info
->
tex_type
=
tex_cube
;
cube_coords_float
(
&
rect
,
w
,
h
,
&
f
);
cube_coords_float
(
rect
,
w
,
h
,
&
f
);
coords
[
0
][
0
]
=
f
.
l
;
coords
[
0
][
1
]
=
-
1
.
0
f
;
coords
[
0
][
2
]
=
-
f
.
t
;
coords
[
1
][
0
]
=
f
.
r
;
coords
[
1
][
1
]
=
-
1
.
0
f
;
coords
[
1
][
2
]
=
-
f
.
t
;
...
...
@@ -253,7 +242,7 @@ static void surface_get_blt_info(GLenum target, const RECT *rect_in, GLsizei w,
info
->
binding
=
GL_TEXTURE_BINDING_CUBE_MAP_ARB
;
info
->
bind_target
=
GL_TEXTURE_CUBE_MAP_ARB
;
info
->
tex_type
=
tex_cube
;
cube_coords_float
(
&
rect
,
w
,
h
,
&
f
);
cube_coords_float
(
rect
,
w
,
h
,
&
f
);
coords
[
0
][
0
]
=
f
.
l
;
coords
[
0
][
1
]
=
-
f
.
t
;
coords
[
0
][
2
]
=
1
.
0
f
;
coords
[
1
][
0
]
=
f
.
r
;
coords
[
1
][
1
]
=
-
f
.
t
;
coords
[
1
][
2
]
=
1
.
0
f
;
...
...
@@ -265,7 +254,7 @@ static void surface_get_blt_info(GLenum target, const RECT *rect_in, GLsizei w,
info
->
binding
=
GL_TEXTURE_BINDING_CUBE_MAP_ARB
;
info
->
bind_target
=
GL_TEXTURE_CUBE_MAP_ARB
;
info
->
tex_type
=
tex_cube
;
cube_coords_float
(
&
rect
,
w
,
h
,
&
f
);
cube_coords_float
(
rect
,
w
,
h
,
&
f
);
coords
[
0
][
0
]
=
-
f
.
l
;
coords
[
0
][
1
]
=
-
f
.
t
;
coords
[
0
][
2
]
=
-
1
.
0
f
;
coords
[
1
][
0
]
=
-
f
.
r
;
coords
[
1
][
1
]
=
-
f
.
t
;
coords
[
1
][
2
]
=
-
1
.
0
f
;
...
...
@@ -4070,6 +4059,7 @@ static void surface_depth_blt(IWineD3DSurfaceImpl *This, const struct wined3d_gl
GLint
compare_mode
=
GL_NONE
;
struct
blt_info
info
;
GLint
old_binding
=
0
;
RECT
rect
;
glPushAttrib
(
GL_ENABLE_BIT
|
GL_DEPTH_BUFFER_BIT
|
GL_COLOR_BUFFER_BIT
|
GL_VIEWPORT_BIT
);
...
...
@@ -4084,7 +4074,8 @@ static void surface_depth_blt(IWineD3DSurfaceImpl *This, const struct wined3d_gl
glColorMask
(
GL_FALSE
,
GL_FALSE
,
GL_FALSE
,
GL_FALSE
);
glViewport
(
0
,
0
,
w
,
h
);
surface_get_blt_info
(
target
,
NULL
,
w
,
h
,
&
info
);
SetRect
(
&
rect
,
0
,
h
,
w
,
0
);
surface_get_blt_info
(
target
,
&
rect
,
w
,
h
,
&
info
);
GL_EXTCALL
(
glActiveTextureARB
(
GL_TEXTURE0_ARB
));
glGetIntegerv
(
info
.
binding
,
&
old_binding
);
glBindTexture
(
info
.
bind_target
,
texture
);
...
...
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