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
51df9314
Commit
51df9314
authored
Jul 08, 2003
by
Lionel Ulmer
Committed by
Alexandre Julliard
Jul 08, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- fix FPS computation
- some TRACEing fixes - optimize BltFast locking rectangles
parent
ae02c5d3
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
68 additions
and
47 deletions
+68
-47
mesa.c
dlls/ddraw/d3ddevice/mesa.c
+3
-2
dib.c
dlls/ddraw/dsurface/dib.c
+59
-44
main.c
dlls/ddraw/dsurface/main.c
+1
-1
mesa.c
dlls/ddraw/mesa.c
+5
-0
No files found.
dlls/ddraw/d3ddevice/mesa.c
View file @
51df9314
...
...
@@ -212,8 +212,8 @@ inline static Drawable get_drawable( HDC hdc )
#ifdef COMPUTE_FPS
#define MEASUREMENT_WINDOW
20
#define NUMBER_OF_WINDOWS
4
#define MEASUREMENT_WINDOW
5
#define NUMBER_OF_WINDOWS
10
static
LONGLONG
perf_freq
;
static
LONGLONG
perf_storage
[
NUMBER_OF_WINDOWS
];
...
...
@@ -279,6 +279,7 @@ static BOOL opengl_flip( LPVOID dev, LPVOID drawable)
current_window
=
0
;
}
perf_storage
[
current_window
]
=
0
;
measurements_in_window
=
0
;
}
}
else
{
prev_time
=
current_time
;
...
...
dlls/ddraw/dsurface/dib.c
View file @
51df9314
...
...
@@ -816,7 +816,7 @@ DIB_DirectDrawSurface_BltFast(LPDIRECTDRAWSURFACE7 iface, DWORD dstx,
HRESULT
ret
=
DD_OK
;
LPBYTE
sbuf
,
dbuf
;
RECT
rsrc2
;
RECT
lock_src
,
lock_dst
;
if
(
TRACE_ON
(
ddraw
))
{
TRACE
(
"(%p)->(%ld,%ld,%p,%p,%08lx)
\n
"
,
...
...
@@ -836,35 +836,49 @@ DIB_DirectDrawSurface_BltFast(LPDIRECTDRAWSURFACE7 iface, DWORD dstx,
if
(
This
->
aux_bltfast
(
This
,
dstx
,
dsty
,
src
,
rsrc
,
trans
)
==
DD_OK
)
return
DD_OK
;
}
/* We need to lock the surfaces, or we won't get refreshes when done. */
sdesc
.
dwSize
=
sizeof
(
sdesc
);
IDirectDrawSurface7_Lock
(
src
,
NULL
,
&
sdesc
,
DDLOCK_READONLY
,
0
);
ddesc
.
dwSize
=
sizeof
(
ddesc
);
IDirectDrawSurface7_Lock
(
iface
,
NULL
,
&
ddesc
,
DDLOCK_WRITEONLY
,
0
);
if
(
!
rsrc
)
{
WARN
(
"rsrc is NULL!
\n
"
);
rsrc
=
&
rsrc2
;
rsrc
->
left
=
rsrc
->
top
=
0
;
rsrc
->
right
=
sdesc
.
dwWidth
;
rsrc
->
bottom
=
sdesc
.
dwHeight
;
}
bpp
=
GET_BPP
(
This
->
surface_desc
);
sbuf
=
(
BYTE
*
)
sdesc
.
lpSurface
+
(
rsrc
->
top
*
sdesc
.
u1
.
lPitch
)
+
rsrc
->
left
*
bpp
;
dbuf
=
(
BYTE
*
)
ddesc
.
lpSurface
+
(
dsty
*
ddesc
.
u1
.
lPitch
)
+
dstx
*
bpp
;
/* Get the surface description without locking to first compute the width / height */
ddesc
=
This
->
surface_desc
;
sdesc
=
(
ICOM_OBJECT
(
IDirectDrawSurfaceImpl
,
IDirectDrawSurface7
,
src
))
->
surface_desc
;
if
(
!
rsrc
)
{
WARN
(
"rsrc is NULL!
\n
"
);
rsrc
=
&
rsrc2
;
rsrc
->
left
=
rsrc
->
top
=
0
;
rsrc
->
right
=
sdesc
.
dwWidth
;
rsrc
->
bottom
=
sdesc
.
dwHeight
;
}
h
=
rsrc
->
bottom
-
rsrc
->
top
;
if
(
h
>
ddesc
.
dwHeight
-
dsty
)
h
=
ddesc
.
dwHeight
-
dsty
;
if
(
h
>
sdesc
.
dwHeight
-
rsrc
->
top
)
h
=
sdesc
.
dwHeight
-
rsrc
->
top
;
if
(
h
<
0
)
h
=
0
;
if
(
h
<
=
0
)
return
DDERR_INVALIDRECT
;
w
=
rsrc
->
right
-
rsrc
->
left
;
if
(
w
>
ddesc
.
dwWidth
-
dstx
)
w
=
ddesc
.
dwWidth
-
dstx
;
if
(
w
>
sdesc
.
dwWidth
-
rsrc
->
left
)
w
=
sdesc
.
dwWidth
-
rsrc
->
left
;
if
(
w
<
0
)
w
=
0
;
if
(
w
<=
0
)
return
DDERR_INVALIDRECT
;
/* Now compute the locking rectangle... */
lock_src
.
left
=
rsrc
->
left
;
lock_src
.
top
=
rsrc
->
top
;
lock_src
.
right
=
lock_src
.
left
+
w
;
lock_src
.
bottom
=
lock_src
.
top
+
h
;
lock_dst
.
left
=
dstx
;
lock_dst
.
top
=
dsty
;
lock_dst
.
right
=
dstx
+
w
;
lock_dst
.
bottom
=
dsty
+
h
;
/* We need to lock the surfaces, or we won't get refreshes when done. */
sdesc
.
dwSize
=
sizeof
(
sdesc
);
IDirectDrawSurface7_Lock
(
src
,
&
lock_src
,
&
sdesc
,
DDLOCK_READONLY
,
0
);
ddesc
.
dwSize
=
sizeof
(
ddesc
);
IDirectDrawSurface7_Lock
(
iface
,
&
lock_dst
,
&
ddesc
,
DDLOCK_WRITEONLY
,
0
);
bpp
=
GET_BPP
(
This
->
surface_desc
);
sbuf
=
(
BYTE
*
)
sdesc
.
lpSurface
;
dbuf
=
(
BYTE
*
)
ddesc
.
lpSurface
;
if
(
trans
&
(
DDBLTFAST_SRCCOLORKEY
|
DDBLTFAST_DESTCOLORKEY
))
{
DWORD
keylow
,
keyhigh
;
if
(
trans
&
DDBLTFAST_SRCCOLORKEY
)
{
...
...
@@ -878,28 +892,28 @@ DIB_DirectDrawSurface_BltFast(LPDIRECTDRAWSURFACE7 iface, DWORD dstx,
}
#define COPYBOX_COLORKEY(type) { \
type *d = (type *)dbuf, *s = (type *)sbuf
, tmp; \
s = (type *) ((BYTE *) sdesc.lpSurface + (rsrc->top * sdesc.u1.lPitch) + rsrc->left * bpp)
; \
d = (type *) ((BYTE *) ddesc.lpSurface + (dsty * ddesc.u1.lPitch) + dstx * bpp)
; \
for (y = 0; y < h; y++) { \
for (x = 0; x < w; x++) { \
tmp = s[x]; \
if (tmp < keylow || tmp > keyhigh) d[x] = tmp; \
} \
(LPBYTE)s += sdesc.u1.lPitch; \
(LPBYTE)d += ddesc.u1.lPitch; \
} \
break; \
}
type *d, *s
, tmp; \
s = (type *) sdesc.lpSurface
; \
d = (type *) ddesc.lpSurface
; \
for (y = 0; y < h; y++) { \
for (x = 0; x < w; x++) { \
tmp = s[x]; \
if (tmp < keylow || tmp > keyhigh) d[x] = tmp; \
} \
(LPBYTE)s += sdesc.u1.lPitch; \
(LPBYTE)d += ddesc.u1.lPitch; \
} \
break; \
}
switch
(
bpp
)
{
case
1
:
COPYBOX_COLORKEY
(
BYTE
)
case
2
:
COPYBOX_COLORKEY
(
WORD
)
case
4
:
COPYBOX_COLORKEY
(
DWORD
)
default:
FIXME
(
"Source color key blitting not supported for bpp %d
\n
"
,
bpp
*
8
);
ret
=
DDERR_UNSUPPORTED
;
goto
error
;
switch
(
bpp
)
{
case
1
:
COPYBOX_COLORKEY
(
BYTE
)
case
2
:
COPYBOX_COLORKEY
(
WORD
)
case
4
:
COPYBOX_COLORKEY
(
DWORD
)
default:
FIXME
(
"Source color key blitting not supported for bpp %d
\n
"
,
bpp
*
8
);
ret
=
DDERR_UNSUPPORTED
;
goto
error
;
}
#undef COPYBOX_COLORKEY
}
else
{
...
...
@@ -911,9 +925,10 @@ DIB_DirectDrawSurface_BltFast(LPDIRECTDRAWSURFACE7 iface, DWORD dstx,
dbuf
+=
ddesc
.
u1
.
lPitch
;
}
}
error:
IDirectDrawSurface7_Unlock
(
iface
,
NULL
);
IDirectDrawSurface7_Unlock
(
src
,
NULL
);
IDirectDrawSurface7_Unlock
(
iface
,
&
lock_dst
);
IDirectDrawSurface7_Unlock
(
src
,
&
lock_src
);
return
ret
;
}
...
...
dlls/ddraw/dsurface/main.c
View file @
51df9314
...
...
@@ -1015,7 +1015,7 @@ Main_DirectDrawSurface_Lock(LPDIRECTDRAWSURFACE7 iface, LPRECT prect,
* (Not documented.) */
if
(
prect
!=
NULL
)
{
TRACE
(
" lprect: %ldx%ld-%ldx%ld
\n
"
,
prect
->
top
,
prect
->
left
,
prect
->
bottom
,
prect
->
right
);
prect
->
left
,
prect
->
top
,
prect
->
right
,
prect
->
bottom
);
/* First do some sanity checkings on the rectangle we receive.
DungeonSiege seems to gives us once a very bad rectangle for example */
if
((
prect
->
top
<
0
)
||
...
...
dlls/ddraw/mesa.c
View file @
51df9314
...
...
@@ -106,6 +106,11 @@ void set_render_state(IDirect3DDeviceImpl* This,
0
,
ICOM_INTERFACE
(
tex
,
IDirectDrawSurface7
));
}
break
;
case
D3DRENDERSTATE_ANTIALIAS
:
/* 2 */
if
(
dwRenderState
)
ERR
(
"D3DRENDERSTATE_ANTIALIAS not supported yet !
\n
"
);
break
;
case
D3DRENDERSTATE_TEXTUREADDRESSU
:
/* 44 */
case
D3DRENDERSTATE_TEXTUREADDRESSV
:
/* 45 */
...
...
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