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
2b832f11
Commit
2b832f11
authored
Oct 31, 2003
by
Jason Edmeades
Committed by
Alexandre Julliard
Oct 31, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make support for CopyRects to a small area of the back buffer, and
correct the general method of updating the back buffer.
parent
99e3e6f8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
6 deletions
+18
-6
device.c
dlls/d3d8/device.c
+1
-1
surface.c
dlls/d3d8/surface.c
+17
-5
No files found.
dlls/d3d8/device.c
View file @
2b832f11
...
...
@@ -1051,7 +1051,7 @@ HRESULT WINAPI IDirect3DDevice8Impl_CopyRects(LPDIRECT3DDEVICE8 iface,
dest_rect
.
left
=
p
->
x
;
dest_rect
.
top
=
p
->
y
;
dest_rect
.
right
=
p
->
x
+
(
r
->
right
-
r
->
left
);
dest_rect
.
left
=
p
->
y
+
(
r
->
bottom
-
r
->
top
);
dest_rect
.
bottom
=
p
->
y
+
(
r
->
bottom
-
r
->
top
);
IDirect3DSurface8Impl_LockRect
((
LPDIRECT3DSURFACE8
)
dst
,
&
lrDst
,
&
dest_rect
,
0L
);
TRACE
(
"Locked src and dst
\n
"
);
...
...
dlls/d3d8/surface.c
View file @
2b832f11
...
...
@@ -280,8 +280,9 @@ HRESULT WINAPI IDirect3DSurface8Impl_LockRect(LPDIRECT3DSURFACE8 iface, D3DLOCKE
}
HRESULT
WINAPI
IDirect3DSurface8Impl_UnlockRect
(
LPDIRECT3DSURFACE8
iface
)
{
GLint
skipBytes
=
0
;
ICOM_THIS
(
IDirect3DSurface8Impl
,
iface
);
if
(
FALSE
==
This
->
locked
)
{
ERR
(
"trying to lock unlocked surf@%p
\n
"
,
This
);
return
D3DERR_INVALIDCALL
;
...
...
@@ -375,19 +376,26 @@ HRESULT WINAPI IDirect3DSurface8Impl_UnlockRect(LPDIRECT3DSURFACE8 iface) {
}
vcheckGLcall
(
"glDrawBuffer"
);
glRasterPos2i
(
This
->
lockedRect
.
left
,
This
->
lockedRect
.
top
);
/* If not fullscreen, we need to skip a number of bytes to find the next row of data */
glGetIntegerv
(
GL_UNPACK_ROW_LENGTH
,
&
skipBytes
);
glPixelStorei
(
GL_UNPACK_ROW_LENGTH
,
This
->
myDesc
.
Width
);
/* And back buffers are not blended */
glDisable
(
GL_BLEND
);
glRasterPos3i
(
This
->
lockedRect
.
left
,
This
->
lockedRect
.
top
,
1
);
vcheckGLcall
(
"glRasterPos2f"
);
switch
(
This
->
myDesc
.
Format
)
{
case
D3DFMT_R5G6B5
:
{
glDrawPixels
(
This
->
lockedRect
.
right
-
This
->
lockedRect
.
left
,
This
->
lockedRect
.
bottom
-
This
->
lockedRect
.
top
,
glDrawPixels
(
This
->
lockedRect
.
right
-
This
->
lockedRect
.
left
,
(
This
->
lockedRect
.
bottom
-
This
->
lockedRect
.
top
)
-
1
,
GL_RGB
,
GL_UNSIGNED_SHORT_5_6_5
,
This
->
allocatedMemory
);
vcheckGLcall
(
"glDrawPixels"
);
}
break
;
case
D3DFMT_R8G8B8
:
{
glDrawPixels
(
This
->
lockedRect
.
right
-
This
->
lockedRect
.
left
,
This
->
lockedRect
.
bottom
-
This
->
lockedRect
.
top
,
glDrawPixels
(
This
->
lockedRect
.
right
-
This
->
lockedRect
.
left
,
(
This
->
lockedRect
.
bottom
-
This
->
lockedRect
.
top
)
-
1
,
GL_RGB
,
GL_UNSIGNED_BYTE
,
This
->
allocatedMemory
);
vcheckGLcall
(
"glDrawPixels"
);
}
...
...
@@ -396,7 +404,7 @@ HRESULT WINAPI IDirect3DSurface8Impl_UnlockRect(LPDIRECT3DSURFACE8 iface) {
{
glPixelStorei
(
GL_PACK_SWAP_BYTES
,
TRUE
);
vcheckGLcall
(
"glPixelStorei"
);
glDrawPixels
(
This
->
lockedRect
.
right
-
This
->
lockedRect
.
left
,
This
->
lockedRect
.
bottom
-
This
->
lockedRect
.
top
,
glDrawPixels
(
This
->
lockedRect
.
right
-
This
->
lockedRect
.
left
,
(
This
->
lockedRect
.
bottom
-
This
->
lockedRect
.
top
)
-
1
,
GL_BGRA
,
GL_UNSIGNED_BYTE
,
This
->
allocatedMemory
);
vcheckGLcall
(
"glDrawPixels"
);
glPixelStorei
(
GL_PACK_SWAP_BYTES
,
prev_store
);
...
...
@@ -414,6 +422,10 @@ HRESULT WINAPI IDirect3DSurface8Impl_UnlockRect(LPDIRECT3DSURFACE8 iface) {
glRasterPos3iv
(
&
prev_rasterpos
[
0
]);
vcheckGLcall
(
"glRasterPos3iv"
);
/* Reset to previous pack row length / blending state */
glPixelStorei
(
GL_UNPACK_ROW_LENGTH
,
skipBytes
);
if
(
This
->
Device
->
StateBlock
->
renderstate
[
D3DRS_ALPHABLENDENABLE
])
glEnable
(
GL_BLEND
);
LEAVE_GL
();
/** restore clean dirty state */
...
...
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