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
cec93d0a
Commit
cec93d0a
authored
Jan 03, 2003
by
Lionel Ulmer
Committed by
Alexandre Julliard
Jan 03, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- re-activate the color-keying code
- fix yet again texture enumeration to please all games :-/
parent
b110a962
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
81 additions
and
32 deletions
+81
-32
mesa.c
dlls/ddraw/d3ddevice/mesa.c
+17
-10
d3dtexture.c
dlls/ddraw/d3dtexture.c
+0
-0
main.c
dlls/ddraw/dsurface/main.c
+63
-22
mesa.c
dlls/ddraw/mesa.c
+1
-0
No files found.
dlls/ddraw/d3ddevice/mesa.c
View file @
cec93d0a
...
@@ -415,16 +415,6 @@ static HRESULT enum_texture_format_OpenGL(LPD3DENUMTEXTUREFORMATSCALLBACK cb_1,
...
@@ -415,16 +415,6 @@ static HRESULT enum_texture_format_OpenGL(LPD3DENUMTEXTUREFORMATSCALLBACK cb_1,
if
(
cb_1
)
if
(
cb_1
(
&
sdesc
,
context
)
==
0
)
return
DD_OK
;
if
(
cb_1
)
if
(
cb_1
(
&
sdesc
,
context
)
==
0
)
return
DD_OK
;
if
(
cb_2
)
if
(
cb_2
(
pformat
,
context
)
==
0
)
return
DD_OK
;
if
(
cb_2
)
if
(
cb_2
(
pformat
,
context
)
==
0
)
return
DD_OK
;
TRACE
(
"Enumerating GL_RGBA packed GL_UNSIGNED_SHORT_5_5_5_1 (16)
\n
"
);
pformat
->
dwFlags
=
DDPF_RGB
|
DDPF_ALPHAPIXELS
;
pformat
->
u1
.
dwRGBBitCount
=
16
;
pformat
->
u2
.
dwRBitMask
=
0x0000F800
;
pformat
->
u3
.
dwGBitMask
=
0x000007C0
;
pformat
->
u4
.
dwBBitMask
=
0x0000003E
;
pformat
->
u5
.
dwRGBAlphaBitMask
=
0x00000001
;
if
(
cb_1
)
if
(
cb_1
(
&
sdesc
,
context
)
==
0
)
return
DD_OK
;
if
(
cb_2
)
if
(
cb_2
(
pformat
,
context
)
==
0
)
return
DD_OK
;
TRACE
(
"Enumerating GL_RGBA packed GL_UNSIGNED_SHORT_4_4_4_4 (ARGB) (16)
\n
"
);
TRACE
(
"Enumerating GL_RGBA packed GL_UNSIGNED_SHORT_4_4_4_4 (ARGB) (16)
\n
"
);
pformat
->
dwFlags
=
DDPF_RGB
|
DDPF_ALPHAPIXELS
;
pformat
->
dwFlags
=
DDPF_RGB
|
DDPF_ALPHAPIXELS
;
pformat
->
u1
.
dwRGBBitCount
=
16
;
pformat
->
u1
.
dwRGBBitCount
=
16
;
...
@@ -435,6 +425,12 @@ static HRESULT enum_texture_format_OpenGL(LPD3DENUMTEXTUREFORMATSCALLBACK cb_1,
...
@@ -435,6 +425,12 @@ static HRESULT enum_texture_format_OpenGL(LPD3DENUMTEXTUREFORMATSCALLBACK cb_1,
if
(
cb_1
)
if
(
cb_1
(
&
sdesc
,
context
)
==
0
)
return
DD_OK
;
if
(
cb_1
)
if
(
cb_1
(
&
sdesc
,
context
)
==
0
)
return
DD_OK
;
if
(
cb_2
)
if
(
cb_2
(
pformat
,
context
)
==
0
)
return
DD_OK
;
if
(
cb_2
)
if
(
cb_2
(
pformat
,
context
)
==
0
)
return
DD_OK
;
#if 0
/* This is a compromise : some games choose the first 16 bit texture format with alpha they
find enumerated, others the last one. And both want to have the ARGB one.
So basically, forget our OpenGL roots and do not even enumerate our RGBA ones.
*/
TRACE("Enumerating GL_RGBA packed GL_UNSIGNED_SHORT_4_4_4_4 (16)\n");
TRACE("Enumerating GL_RGBA packed GL_UNSIGNED_SHORT_4_4_4_4 (16)\n");
pformat->dwFlags = DDPF_RGB | DDPF_ALPHAPIXELS;
pformat->dwFlags = DDPF_RGB | DDPF_ALPHAPIXELS;
pformat->u1.dwRGBBitCount = 16;
pformat->u1.dwRGBBitCount = 16;
...
@@ -445,6 +441,17 @@ static HRESULT enum_texture_format_OpenGL(LPD3DENUMTEXTUREFORMATSCALLBACK cb_1,
...
@@ -445,6 +441,17 @@ static HRESULT enum_texture_format_OpenGL(LPD3DENUMTEXTUREFORMATSCALLBACK cb_1,
if (cb_1) if (cb_1(&sdesc , context) == 0) return DD_OK;
if (cb_1) if (cb_1(&sdesc , context) == 0) return DD_OK;
if (cb_2) if (cb_2(pformat, context) == 0) return DD_OK;
if (cb_2) if (cb_2(pformat, context) == 0) return DD_OK;
TRACE("Enumerating GL_RGBA packed GL_UNSIGNED_SHORT_5_5_5_1 (16)\n");
pformat->dwFlags = DDPF_RGB | DDPF_ALPHAPIXELS;
pformat->u1.dwRGBBitCount = 16;
pformat->u2.dwRBitMask = 0x0000F800;
pformat->u3.dwGBitMask = 0x000007C0;
pformat->u4.dwBBitMask = 0x0000003E;
pformat->u5.dwRGBAlphaBitMask = 0x00000001;
if (cb_1) if (cb_1(&sdesc , context) == 0) return DD_OK;
if (cb_2) if (cb_2(pformat, context) == 0) return DD_OK;
#endif
TRACE
(
"Enumerating GL_RGB packed GL_UNSIGNED_BYTE_3_3_2 (8)
\n
"
);
TRACE
(
"Enumerating GL_RGB packed GL_UNSIGNED_BYTE_3_3_2 (8)
\n
"
);
pformat
->
dwFlags
=
DDPF_RGB
;
pformat
->
dwFlags
=
DDPF_RGB
;
pformat
->
u1
.
dwRGBBitCount
=
8
;
pformat
->
u1
.
dwRGBBitCount
=
8
;
...
...
dlls/ddraw/d3dtexture.c
View file @
cec93d0a
This diff is collapsed.
Click to expand it.
dlls/ddraw/dsurface/main.c
View file @
cec93d0a
...
@@ -735,6 +735,11 @@ Main_DirectDrawSurface_GetColorKey(LPDIRECTDRAWSURFACE7 iface, DWORD dwFlags,
...
@@ -735,6 +735,11 @@ Main_DirectDrawSurface_GetColorKey(LPDIRECTDRAWSURFACE7 iface, DWORD dwFlags,
ICOM_THIS
(
IDirectDrawSurfaceImpl
,
iface
);
ICOM_THIS
(
IDirectDrawSurfaceImpl
,
iface
);
TRACE
(
"(%p)->(%08lx,%p)
\n
"
,
This
,
dwFlags
,
pCKey
);
TRACE
(
"(%p)->(%08lx,%p)
\n
"
,
This
,
dwFlags
,
pCKey
);
if
(
TRACE_ON
(
ddraw
))
{
TRACE
(
" - colorkey flags : "
);
DDRAW_dump_colorkeyflag
(
dwFlags
);
}
switch
(
dwFlags
)
switch
(
dwFlags
)
{
{
case
DDCKEY_DESTBLT
:
case
DDCKEY_DESTBLT
:
...
@@ -1095,37 +1100,73 @@ Main_DirectDrawSurface_SetColorKey(LPDIRECTDRAWSURFACE7 iface,
...
@@ -1095,37 +1100,73 @@ Main_DirectDrawSurface_SetColorKey(LPDIRECTDRAWSURFACE7 iface,
DWORD
dwFlags
,
LPDDCOLORKEY
pCKey
)
DWORD
dwFlags
,
LPDDCOLORKEY
pCKey
)
{
{
ICOM_THIS
(
IDirectDrawSurfaceImpl
,
iface
);
ICOM_THIS
(
IDirectDrawSurfaceImpl
,
iface
);
TRACE
(
"(%p)->(%08lx,%p)
\n
"
,
This
,
dwFlags
,
pCKey
);
TRACE
(
"(%p)->(%08lx,%p)
\n
"
,
This
,
dwFlags
,
pCKey
);
if
(
pCKey
==
NULL
)
{
if
(
TRACE_ON
(
ddraw
))
{
FIXME
(
"supposedly removing color key %lu
\n
"
,
TRACE
(
" - colorkey flags : "
);
dwFlags
&
~
DDCKEY_COLORSPACE
);
DDRAW_dump_colorkeyflag
(
dwFlags
);
return
DD_OK
;
}
}
switch
(
dwFlags
&
~
DDCKEY_COLORSPACE
)
if
((
dwFlags
&
DDCKEY_COLORSPACE
)
!=
0
)
{
{
FIXME
(
" colorkey value not supported (%08lx) !
\n
"
,
dwFlags
);
case
DDCKEY_DESTBLT
:
return
DDERR_INVALIDPARAMS
;
This
->
surface_desc
.
ddckCKDestBlt
=
*
pCKey
;
}
break
;
/* TODO: investigate if this function can take multiple bits set at the same
time (ie setting multiple colorkey values at the same time with only
one API call).
*/
if
(
pCKey
)
{
switch
(
dwFlags
&
~
DDCKEY_COLORSPACE
)
{
case
DDCKEY_DESTBLT
:
This
->
surface_desc
.
ddckCKDestBlt
=
*
pCKey
;
This
->
surface_desc
.
dwFlags
|=
DDSD_CKDESTBLT
;
break
;
case
DDCKEY_DESTOVERLAY
:
case
DDCKEY_DESTOVERLAY
:
This
->
surface_desc
.
u3
.
ddckCKDestOverlay
=
*
pCKey
;
This
->
surface_desc
.
u3
.
ddckCKDestOverlay
=
*
pCKey
;
break
;
This
->
surface_desc
.
dwFlags
|=
DDSD_CKDESTOVERLAY
;
break
;
case
DDCKEY_SRCOVERLAY
:
case
DDCKEY_SRCOVERLAY
:
This
->
surface_desc
.
ddckCKSrcOverlay
=
*
pCKey
;
This
->
surface_desc
.
ddckCKSrcOverlay
=
*
pCKey
;
break
;
This
->
surface_desc
.
dwFlags
|=
DDSD_CKSRCOVERLAY
;
break
;
case
DDCKEY_SRCBLT
:
case
DDCKEY_SRCBLT
:
This
->
surface_desc
.
ddckCKSrcBlt
=
*
pCKey
;
This
->
surface_desc
.
ddckCKSrcBlt
=
*
pCKey
;
break
;
This
->
surface_desc
.
dwFlags
|=
DDSD_CKSRCBLT
;
break
;
default:
default:
return
DDERR_INVALIDPARAMS
;
return
DDERR_INVALIDPARAMS
;
}
}
else
{
switch
(
dwFlags
&
~
DDCKEY_COLORSPACE
)
{
case
DDCKEY_DESTBLT
:
This
->
surface_desc
.
dwFlags
&=
~
DDSD_CKDESTBLT
;
break
;
case
DDCKEY_DESTOVERLAY
:
This
->
surface_desc
.
dwFlags
&=
~
DDSD_CKDESTOVERLAY
;
break
;
case
DDCKEY_SRCOVERLAY
:
This
->
surface_desc
.
dwFlags
&=
~
DDSD_CKSRCOVERLAY
;
break
;
case
DDCKEY_SRCBLT
:
This
->
surface_desc
.
dwFlags
&=
~
DDSD_CKSRCBLT
;
break
;
default:
return
DDERR_INVALIDPARAMS
;
}
}
}
if
(
This
->
aux_setcolorkey_cb
)
This
->
aux_setcolorkey_cb
(
This
,
dwFlags
,
pCKey
);
return
DD_OK
;
return
DD_OK
;
}
}
...
...
dlls/ddraw/mesa.c
View file @
cec93d0a
...
@@ -401,6 +401,7 @@ void set_render_state(IDirect3DDeviceGLImpl* This,
...
@@ -401,6 +401,7 @@ void set_render_state(IDirect3DDeviceGLImpl* This,
case
D3DRENDERSTATE_COLORKEYENABLE
:
/* 41 */
case
D3DRENDERSTATE_COLORKEYENABLE
:
/* 41 */
/* This needs to be fixed. */
if
(
dwRenderState
)
if
(
dwRenderState
)
glEnable
(
GL_BLEND
);
glEnable
(
GL_BLEND
);
else
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