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
fd99ab78
Commit
fd99ab78
authored
Mar 18, 2010
by
Roderick Colenbrander
Committed by
Alexandre Julliard
Mar 19, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Use draw_textured_quad in BltOverride.
parent
4bd627cc
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
1 addition
and
97 deletions
+1
-97
surface.c
dlls/wined3d/surface.c
+1
-45
utils.c
dlls/wined3d/utils.c
+0
-50
wined3d_private.h
dlls/wined3d/wined3d_private.h
+0
-2
No files found.
dlls/wined3d/surface.c
View file @
fd99ab78
...
...
@@ -3964,7 +3964,6 @@ static HRESULT IWineD3DSurfaceImpl_BltOverride(IWineD3DSurfaceImpl *This, const
return
WINED3D_OK
;
}
else
if
(
Src
)
{
/* Blit from offscreen surface to render target */
float
glTexCoord
[
4
];
DWORD
oldCKeyFlags
=
Src
->
CKeyFlags
;
WINEDDCOLORKEY
oldBltCKey
=
Src
->
SrcBltCKey
;
struct
wined3d_context
*
context
;
...
...
@@ -4014,14 +4013,6 @@ static HRESULT IWineD3DSurfaceImpl_BltOverride(IWineD3DSurfaceImpl *This, const
return
WINED3D_OK
;
}
if
(
!
CalculateTexRect
(
Src
,
&
SourceRectangle
,
glTexCoord
))
{
/* Fall back to software */
WARN
(
"(%p) Source texture area (%d,%d)-(%d,%d) is too big
\n
"
,
Src
,
SourceRectangle
.
left
,
SourceRectangle
.
top
,
SourceRectangle
.
right
,
SourceRectangle
.
bottom
);
return
WINED3DERR_INVALIDCALL
;
}
/* Color keying: Check if we have to do a color keyed blt,
* and if not check if a color key is activated.
*
...
...
@@ -4083,22 +4074,6 @@ static HRESULT IWineD3DSurfaceImpl_BltOverride(IWineD3DSurfaceImpl *This, const
ENTER_GL
();
/* Bind the texture */
glBindTexture
(
Src
->
texture_target
,
Src
->
texture_name
);
checkGLcall
(
"glBindTexture"
);
/* Filtering for StretchRect */
glTexParameteri
(
Src
->
texture_target
,
GL_TEXTURE_MAG_FILTER
,
wined3d_gl_mag_filter
(
magLookup
,
Filter
));
checkGLcall
(
"glTexParameteri"
);
glTexParameteri
(
Src
->
texture_target
,
GL_TEXTURE_MIN_FILTER
,
wined3d_gl_min_mip_filter
(
minMipLookup
,
Filter
,
WINED3DTEXF_NONE
));
checkGLcall
(
"glTexParameteri"
);
glTexParameteri
(
Src
->
texture_target
,
GL_TEXTURE_WRAP_S
,
GL_CLAMP
);
glTexParameteri
(
Src
->
texture_target
,
GL_TEXTURE_WRAP_T
,
GL_CLAMP
);
glTexEnvi
(
GL_TEXTURE_ENV
,
GL_TEXTURE_ENV_MODE
,
GL_REPLACE
);
checkGLcall
(
"glTexEnvi"
);
/* This is for color keying */
if
(
Flags
&
(
WINEDDBLT_KEYSRC
|
WINEDDBLT_KEYSRCOVERRIDE
))
{
glEnable
(
GL_ALPHA_TEST
);
...
...
@@ -4119,32 +4094,13 @@ static HRESULT IWineD3DSurfaceImpl_BltOverride(IWineD3DSurfaceImpl *This, const
/* Draw a textured quad
*/
glBegin
(
GL_QUADS
);
glColor3f
(
1
.
0
f
,
1
.
0
f
,
1
.
0
f
);
glTexCoord2f
(
glTexCoord
[
0
],
glTexCoord
[
2
]);
glVertex3f
(
rect
.
x1
,
rect
.
y1
,
0
.
0
f
);
glTexCoord2f
(
glTexCoord
[
0
],
glTexCoord
[
3
]);
glVertex3f
(
rect
.
x1
,
rect
.
y2
,
0
.
0
f
);
glTexCoord2f
(
glTexCoord
[
1
],
glTexCoord
[
3
]);
glVertex3f
(
rect
.
x2
,
rect
.
y2
,
0
.
0
f
);
glTexCoord2f
(
glTexCoord
[
1
],
glTexCoord
[
2
]);
glVertex3f
(
rect
.
x2
,
rect
.
y1
,
0
.
0
f
);
glEnd
();
checkGLcall
(
"glEnd"
);
draw_textured_quad
(
Src
,
&
SourceRectangle
,
(
RECT
*
)
&
rect
,
Filter
);
if
(
Flags
&
(
WINEDDBLT_KEYSRC
|
WINEDDBLT_KEYSRCOVERRIDE
))
{
glDisable
(
GL_ALPHA_TEST
);
checkGLcall
(
"glDisable(GL_ALPHA_TEST)"
);
}
glBindTexture
(
Src
->
texture_target
,
0
);
checkGLcall
(
"glBindTexture(Src->texture_target, 0)"
);
/* Restore the color key parameters */
Src
->
CKeyFlags
=
oldCKeyFlags
;
Src
->
SrcBltCKey
=
oldBltCKey
;
...
...
dlls/wined3d/utils.c
View file @
fd99ab78
...
...
@@ -2258,56 +2258,6 @@ DWORD get_flexible_vertex_size(DWORD d3dvtVertexType) {
return
size
;
}
/***********************************************************************
* CalculateTexRect
*
* Calculates the dimensions of the opengl texture used for blits.
* Handled oversized opengl textures and updates the source rectangle
* accordingly
*
* Params:
* This: Surface to operate on
* Rect: Requested rectangle
*
* Returns:
* TRUE if the texture part can be loaded,
* FALSE otherwise
*
*********************************************************************/
BOOL
CalculateTexRect
(
IWineD3DSurfaceImpl
*
This
,
RECT
*
Rect
,
float
glTexCoord
[
4
])
{
int
x1
=
Rect
->
left
,
x2
=
Rect
->
right
;
int
y1
=
Rect
->
top
,
y2
=
Rect
->
bottom
;
TRACE
(
"(%p)->(%d,%d)-(%d,%d)
\n
"
,
This
,
Rect
->
left
,
Rect
->
top
,
Rect
->
right
,
Rect
->
bottom
);
/* The sizes might be reversed */
if
(
Rect
->
left
>
Rect
->
right
)
{
x1
=
Rect
->
right
;
x2
=
Rect
->
left
;
}
if
(
Rect
->
top
>
Rect
->
bottom
)
{
y1
=
Rect
->
bottom
;
y2
=
Rect
->
top
;
}
/* Which rect from the texture do I need? */
if
(
This
->
texture_target
==
GL_TEXTURE_RECTANGLE_ARB
)
{
glTexCoord
[
0
]
=
(
float
)
Rect
->
left
;
glTexCoord
[
2
]
=
(
float
)
Rect
->
top
;
glTexCoord
[
1
]
=
(
float
)
Rect
->
right
;
glTexCoord
[
3
]
=
(
float
)
Rect
->
bottom
;
}
else
{
glTexCoord
[
0
]
=
(
float
)
Rect
->
left
/
(
float
)
This
->
pow2Width
;
glTexCoord
[
2
]
=
(
float
)
Rect
->
top
/
(
float
)
This
->
pow2Height
;
glTexCoord
[
1
]
=
(
float
)
Rect
->
right
/
(
float
)
This
->
pow2Width
;
glTexCoord
[
3
]
=
(
float
)
Rect
->
bottom
/
(
float
)
This
->
pow2Height
;
}
return
TRUE
;
}
void
gen_ffp_frag_op
(
IWineD3DStateBlockImpl
*
stateblock
,
struct
ffp_frag_settings
*
settings
,
BOOL
ignore_textype
)
{
#define ARG1 0x01
#define ARG2 0x02
...
...
dlls/wined3d/wined3d_private.h
View file @
fd99ab78
...
...
@@ -2202,8 +2202,6 @@ void flip_surface(IWineD3DSurfaceImpl *front, IWineD3DSurfaceImpl *back) DECLSPE
SFLAG_DS_OFFSCREEN)
#define SFLAG_DS_DISCARDED SFLAG_DS_LOCATIONS
BOOL
CalculateTexRect
(
IWineD3DSurfaceImpl
*
This
,
RECT
*
Rect
,
float
glTexCoord
[
4
])
DECLSPEC_HIDDEN
;
typedef
enum
{
NO_CONVERSION
,
CONVERT_PALETTED
,
...
...
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