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
9914a8ec
Commit
9914a8ec
authored
May 08, 2003
by
Lionel Ulmer
Committed by
Alexandre Julliard
May 08, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- only enumerate 32 bpp ARGB texture format and remove RGBA one
- add support for 32 bpp ARGB texture format
parent
5548822a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
0 deletions
+42
-0
mesa.c
dlls/ddraw/d3ddevice/mesa.c
+13
-0
d3dtexture.c
dlls/ddraw/d3dtexture.c
+29
-0
No files found.
dlls/ddraw/d3ddevice/mesa.c
View file @
9914a8ec
...
...
@@ -385,6 +385,8 @@ static HRESULT enum_texture_format_OpenGL(LPD3DENUMTEXTUREFORMATSCALLBACK cb_1,
pformat
->
dwSize
=
sizeof
(
DDPIXELFORMAT
);
pformat
->
dwFourCC
=
0
;
#if 0
/* See argument about the RGBA format for 'packed' texture formats */
TRACE("Enumerating GL_RGBA unpacked (32)\n");
pformat->dwFlags = DDPF_RGB | DDPF_ALPHAPIXELS;
pformat->u1.dwRGBBitCount = 32;
...
...
@@ -394,6 +396,17 @@ static HRESULT enum_texture_format_OpenGL(LPD3DENUMTEXTUREFORMATSCALLBACK cb_1,
pformat->u5.dwRGBAlphaBitMask = 0x000000FF;
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_RGBA unpacked (32)
\n
"
);
pformat
->
dwFlags
=
DDPF_RGB
|
DDPF_ALPHAPIXELS
;
pformat
->
u1
.
dwRGBBitCount
=
32
;
pformat
->
u2
.
dwRBitMask
=
0x00FF0000
;
pformat
->
u3
.
dwGBitMask
=
0x0000FF00
;
pformat
->
u4
.
dwBBitMask
=
0x000000FF
;
pformat
->
u5
.
dwRGBAlphaBitMask
=
0xFF000000
;
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_RGB unpacked (24)
\n
"
);
pformat
->
dwFlags
=
DDPF_RGB
;
...
...
dlls/ddraw/d3dtexture.c
View file @
9914a8ec
...
...
@@ -386,6 +386,35 @@ gltex_upload_texture(IDirectDrawSurfaceImpl *This) {
}
else
if
((
src_d
->
ddpfPixelFormat
.
u2
.
dwRBitMask
==
0x00FF0000
)
&&
(
src_d
->
ddpfPixelFormat
.
u3
.
dwGBitMask
==
0x0000FF00
)
&&
(
src_d
->
ddpfPixelFormat
.
u4
.
dwBBitMask
==
0x000000FF
)
&&
(
src_d
->
ddpfPixelFormat
.
u5
.
dwRGBAlphaBitMask
==
0xFF000000
))
{
/* Convert from ARGB (Windows' format) to RGBA.
Note: need to check for GL extensions handling ARGB instead of always converting */
DWORD
i
;
DWORD
*
src
=
(
DWORD
*
)
src_d
->
lpSurface
,
*
dst
;
surface
=
(
DWORD
*
)
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
src_d
->
dwWidth
*
src_d
->
dwHeight
*
sizeof
(
DWORD
));
dst
=
(
DWORD
*
)
surface
;
if
(
src_d
->
dwFlags
&
DDSD_CKSRCBLT
)
{
for
(
i
=
0
;
i
<
src_d
->
dwHeight
*
src_d
->
dwWidth
;
i
++
)
{
DWORD
color
=
*
src
++
;
*
dst
=
(
color
&
0x00FFFFFF
)
<<
8
;
if
((
color
<
src_d
->
ddckCKSrcBlt
.
dwColorSpaceLowValue
)
||
(
color
>
src_d
->
ddckCKSrcBlt
.
dwColorSpaceHighValue
))
*
dst
|=
(
color
&
0xFF000000
)
>>
24
;
dst
++
;
}
}
else
{
for
(
i
=
0
;
i
<
src_d
->
dwHeight
*
src_d
->
dwWidth
;
i
++
)
{
DWORD
color
=
*
src
++
;
*
dst
=
(
color
&
0x00FFFFFF
)
<<
8
;
*
dst
|=
(
color
&
0xFF000000
)
>>
24
;
}
}
format
=
GL_RGBA
;
pixel_format
=
GL_UNSIGNED_INT_8_8_8_8
;
}
else
if
((
src_d
->
ddpfPixelFormat
.
u2
.
dwRBitMask
==
0x00FF0000
)
&&
(
src_d
->
ddpfPixelFormat
.
u3
.
dwGBitMask
==
0x0000FF00
)
&&
(
src_d
->
ddpfPixelFormat
.
u4
.
dwBBitMask
==
0x000000FF
)
&&
(
src_d
->
ddpfPixelFormat
.
u5
.
dwRGBAlphaBitMask
==
0x00000000
))
{
/* Just add an alpha component and handle color-keying... */
DWORD
i
;
...
...
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