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
b636bde3
Commit
b636bde3
authored
Oct 10, 1998
by
Peter Schlaile
Committed by
Alexandre Julliard
Oct 10, 1998
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed a lot of bugs in ddraw.c to make xlib support work.
Runs successfully TR2Demo and Jazz Jackrabbit II Demo!
parent
105dc76b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
13 deletions
+28
-13
ddraw.c
graphics/ddraw.c
+28
-13
No files found.
graphics/ddraw.c
View file @
b636bde3
...
...
@@ -376,8 +376,9 @@ static HRESULT WINAPI Xlib_IDirectDrawSurface3_Unlock(
this
->
t
.
xlib
.
image
->
width
,
this
->
t
.
xlib
.
image
->
height
);
TSXSetWindowColormap
(
display
,
this
->
s
.
ddraw
->
e
.
xlib
.
drawable
,
this
->
s
.
palette
->
cm
);
if
(
this
->
s
.
palette
&&
this
->
s
.
palette
->
cm
)
{
TSXSetWindowColormap
(
display
,
this
->
s
.
ddraw
->
e
.
xlib
.
drawable
,
this
->
s
.
palette
->
cm
);
}
return
DD_OK
;
}
...
...
@@ -420,6 +421,7 @@ static HRESULT WINAPI DGA_IDirectDrawSurface3_Flip(
static
HRESULT
WINAPI
Xlib_IDirectDrawSurface3_Flip
(
LPDIRECTDRAWSURFACE3
this
,
LPDIRECTDRAWSURFACE3
flipto
,
DWORD
dwFlags
)
{
TRACE
(
ddraw
,
"(%p)->Flip(%p,%08lx)
\n
"
,
this
,
flipto
,
dwFlags
);
Xlib_MessagePump
(
this
->
s
.
ddraw
->
e
.
xlib
.
window
);
if
(
!
this
->
s
.
ddraw
->
e
.
xlib
.
paintable
)
...
...
@@ -431,7 +433,7 @@ static HRESULT WINAPI Xlib_IDirectDrawSurface3_Flip(
else
flipto
=
this
;
}
TSXPutImage
(
display
,
this
->
s
.
ddraw
->
e
.
xlib
.
drawable
,
DefaultGCOfScreen
(
screen
),
...
...
@@ -439,7 +441,11 @@ static HRESULT WINAPI Xlib_IDirectDrawSurface3_Flip(
0
,
0
,
0
,
0
,
flipto
->
t
.
xlib
.
image
->
width
,
flipto
->
t
.
xlib
.
image
->
height
);
TSXSetWindowColormap
(
display
,
this
->
s
.
ddraw
->
e
.
xlib
.
drawable
,
this
->
s
.
palette
->
cm
);
if
(
this
->
s
.
palette
&&
this
->
s
.
palette
->
cm
)
{
TSXSetWindowColormap
(
display
,
this
->
s
.
ddraw
->
e
.
xlib
.
drawable
,
this
->
s
.
palette
->
cm
);
}
if
(
flipto
!=
this
)
{
XImage
*
tmp
;
LPVOID
*
surf
;
...
...
@@ -493,7 +499,9 @@ static HRESULT WINAPI IDirectDrawSurface3_SetPalette(
}
/* Perform the refresh */
TSXSetWindowColormap
(
display
,
this
->
s
.
ddraw
->
e
.
xlib
.
drawable
,
this
->
s
.
palette
->
cm
);
TSXSetWindowColormap
(
display
,
this
->
s
.
ddraw
->
e
.
xlib
.
drawable
,
this
->
s
.
palette
->
cm
);
}
return
0
;
...
...
@@ -670,7 +678,9 @@ static ULONG WINAPI Xlib_IDirectDrawSurface3_Release(LPDIRECTDRAWSURFACE3 this)
TSXDestroyImage
(
this
->
t
.
xlib
.
image
);
this
->
t
.
xlib
.
image
=
0
;
this
->
s
.
palette
->
lpvtbl
->
fnRelease
(
this
->
s
.
palette
);
if
(
this
->
s
.
palette
)
{
this
->
s
.
palette
->
lpvtbl
->
fnRelease
(
this
->
s
.
palette
);
}
HeapFree
(
GetProcessHeap
(),
0
,
this
);
return
0
;
...
...
@@ -1354,10 +1364,9 @@ static HRESULT WINAPI Xlib_IDirectDraw2_CreateSurface(
(
lpddsd
->
ddsCaps
.
dwCaps
&
DDSCAPS_OFFSCREENPLAIN
)
)
{
if
(
!
(
lpddsd
->
dwFlags
&
DDSD_WIDTH
))
lpddsd
->
dwWidth
=
this
->
e
.
dga
.
fb_
width
;
lpddsd
->
dwWidth
=
this
->
d
.
width
;
if
(
!
(
lpddsd
->
dwFlags
&
DDSD_HEIGHT
))
lpddsd
->
dwHeight
=
this
->
e
.
dga
.
fb_height
;
(
*
lpdsf
)
->
s
.
surface
=
(
LPBYTE
)
HeapAlloc
(
GetProcessHeap
(),
0
,
lpddsd
->
dwWidth
*
lpddsd
->
dwHeight
*
this
->
d
.
depth
/
8
);
lpddsd
->
dwHeight
=
this
->
d
.
height
;
TRACE
(
ddraw
,
"using system memory for a primary surface
\n
"
);
}
else
{
TRACE
(
ddraw
,
"using standard XImage for a primary surface
\n
"
);
...
...
@@ -1366,11 +1375,12 @@ static HRESULT WINAPI Xlib_IDirectDraw2_CreateSurface(
lpddsd
->
dwWidth
=
this
->
d
.
width
;
if
(
!
(
lpddsd
->
dwFlags
&
DDSD_HEIGHT
))
lpddsd
->
dwHeight
=
this
->
d
.
height
;
(
*
lpdsf
)
->
s
.
surface
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
lpddsd
->
dwHeight
*
lpddsd
->
dwWidth
);
(
*
lpdsf
)
->
s
.
width
=
lpddsd
->
dwWidth
;
(
*
lpdsf
)
->
s
.
height
=
lpddsd
->
dwHeight
;
}
(
*
lpdsf
)
->
s
.
surface
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
lpddsd
->
dwHeight
*
lpddsd
->
dwWidth
*
this
->
d
.
depth
/
8
);
(
*
lpdsf
)
->
s
.
width
=
lpddsd
->
dwWidth
;
(
*
lpdsf
)
->
s
.
height
=
lpddsd
->
dwHeight
;
{
(
*
lpdsf
)
->
t
.
xlib
.
image
=
img
=
TSXCreateImage
(
display
,
...
...
@@ -1387,6 +1397,7 @@ static HRESULT WINAPI Xlib_IDirectDraw2_CreateSurface(
);
/* END FIXME: Xlib */
}
(
*
lpdsf
)
->
s
.
lpitch
=
img
->
bytes_per_line
;
if
(
lpddsd
->
dwFlags
&
DDSD_BACKBUFFERCOUNT
)
{
LPDIRECTDRAWSURFACE3
back
;
...
...
@@ -1532,11 +1543,13 @@ static HRESULT WINAPI Xlib_IDirectDraw_SetDisplayMode(
MessageBox32A
(
0
,
buf
,
"WINE DirectDraw"
,
MB_OK
|
MB_ICONSTOP
);
return
DDERR_UNSUPPORTEDMODE
;
}
/*
if (this->d.width < width) {
sprintf(buf,"SetDisplayMode(w=%ld,h=%ld,d=%ld), width %ld exceeds framebuffer width %ld",width,height,depth,width,this->d.width);
MessageBox32A(0,buf,"WINE DirectDraw",MB_OK|MB_ICONSTOP);
return DDERR_UNSUPPORTEDMODE;
}
*/
this
->
e
.
xlib
.
window
=
CreateWindowEx32A
(
0
,
"WINE_DirectDraw"
,
...
...
@@ -1572,8 +1585,9 @@ static HRESULT WINAPI Xlib_IDirectDraw_SetDisplayMode(
this
->
d
.
width
=
width
;
this
->
d
.
height
=
height
;
/* adjust fb_height, so we don't overlap */
/*
if (this->e.dga.fb_height < height)
this
->
e
.
dga
.
fb_height
=
height
;
this->e.dga.fb_height = height; */
this
->
d
.
depth
=
depth
;
return
0
;
}
...
...
@@ -1672,6 +1686,7 @@ static HRESULT WINAPI Xlib_IDirectDraw2_CreatePalette(
* TSXInstallColormap(display,(*lpddpal)->cm);
* TSXSetWindowColormap(display,this->e.xlib.drawable,(*lpddpal)->cm);
*/
TSXInstallColormap
(
display
,(
*
lpddpal
)
->
cm
);
}
else
{
...
...
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