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
de036ff6
Commit
de036ff6
authored
Feb 15, 2007
by
Stefan Dösinger
Committed by
Alexandre Julliard
Feb 15, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Convert and load U8V8 surfaces as rgb.
GL_INDEX is definitly not the way to load U8V8 surfaces
parent
99576ea2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
2 deletions
+35
-2
surface.c
dlls/wined3d/surface.c
+34
-1
utils.c
dlls/wined3d/utils.c
+1
-1
No files found.
dlls/wined3d/surface.c
View file @
de036ff6
...
...
@@ -44,7 +44,8 @@ typedef enum {
CONVERT_CK_RGB24
,
CONVERT_CK_8888
,
CONVERT_CK_8888_ARGB
,
CONVERT_RGB32_888
CONVERT_RGB32_888
,
CONVERT_V8U8
}
CONVERT_TYPES
;
HRESULT
d3dfmt_convert_surface
(
BYTE
*
src
,
BYTE
*
dst
,
UINT
pitch
,
UINT
width
,
UINT
height
,
UINT
outpitch
,
CONVERT_TYPES
convert
,
IWineD3DSurfaceImpl
*
surf
);
...
...
@@ -71,6 +72,11 @@ static void surface_download_data(IWineD3DSurfaceImpl *This) {
int
src_pitch
=
0
;
int
dst_pitch
=
0
;
if
(
This
->
Flags
&
SFLAG_CONVERTED
)
{
FIXME
(
"Read back converted textures unsupported
\n
"
);
return
;
}
if
(
This
->
Flags
&
SFLAG_NONPOW2
)
{
src_pitch
=
This
->
bytesPerPixel
*
This
->
pow2Width
;
dst_pitch
=
IWineD3DSurface_GetPitch
((
IWineD3DSurface
*
)
This
);
...
...
@@ -1405,6 +1411,14 @@ HRESULT d3dfmt_get_conv(IWineD3DSurfaceImpl *This, BOOL need_alpha_ck, BOOL use_
}
break
;
case
WINED3DFMT_V8U8
:
*
convert
=
CONVERT_V8U8
;
*
format
=
GL_BGR
;
*
internal
=
GL_RGB8
;
*
type
=
GL_BYTE
;
*
target_bpp
=
3
;
break
;
default:
break
;
}
...
...
@@ -1524,6 +1538,25 @@ HRESULT d3dfmt_convert_surface(BYTE *src, BYTE *dst, UINT pitch, UINT width, UIN
}
break
;
case
CONVERT_V8U8
:
{
unsigned
int
x
,
y
;
short
*
Source
;
char
*
Dest
;
for
(
y
=
0
;
y
<
height
;
y
++
)
{
Source
=
(
short
*
)
(
src
+
y
*
pitch
);
Dest
=
(
char
*
)
(
dst
+
y
*
outpitch
);
for
(
x
=
0
;
x
<
width
;
x
++
)
{
long
color
=
(
*
Source
++
);
Dest
[
0
]
=
color
>>
8
;
Dest
[
1
]
=
color
;
Dest
[
2
]
=
0xff
;
Dest
+=
3
;
}
}
break
;
}
default:
ERR
(
"Unsupported conversation type %d
\n
"
,
convert
);
}
...
...
dlls/wined3d/utils.c
View file @
de036ff6
...
...
@@ -82,7 +82,7 @@ static const PixelFormatDesc formats[] = {
{
WINED3DFMT_A8L8
,
0x0000ff00
,
0x0
,
0x0
,
0x0
,
2
,
FALSE
,
GL_LUMINANCE8_ALPHA8
,
GL_LUMINANCE_ALPHA
,
GL_UNSIGNED_BYTE
},
{
WINED3DFMT_A4L4
,
0x000000f0
,
0x0
,
0x0
,
0x0
,
1
,
FALSE
,
GL_LUMINANCE4_ALPHA4
,
GL_LUMINANCE_ALPHA
,
GL_UNSIGNED_BYTE
},
/* Bump mapping stuff */
{
WINED3DFMT_V8U8
,
0x0
,
0x0
,
0x0
,
0x0
,
2
,
FALSE
,
GL_
COLOR_INDEX8_EXT
,
GL_COLOR_INDEX
,
GL_UNSIGNED_BYTE
},
{
WINED3DFMT_V8U8
,
0x0
,
0x0
,
0x0
,
0x0
,
2
,
FALSE
,
GL_
RGB8
,
GL_BGR
,
GL_BYTE
/* needs conversion! */
},
{
WINED3DFMT_L6V5U5
,
0x0
,
0x0
,
0x0
,
0x0
,
2
,
FALSE
,
GL_COLOR_INDEX8_EXT
,
GL_COLOR_INDEX
,
GL_UNSIGNED_SHORT_5_5_5_1
},
{
WINED3DFMT_X8L8V8U8
,
0x0
,
0x0
,
0x0
,
0x0
,
4
,
FALSE
,
GL_RGBA8
,
GL_BGRA
,
GL_UNSIGNED_BYTE
},
{
WINED3DFMT_Q8W8V8U8
,
0x0
,
0x0
,
0x0
,
0x0
,
4
,
FALSE
,
GL_RGBA8
,
GL_RGBA
,
GL_UNSIGNED_INT_8_8_8_8_REV
/*?*/
},
...
...
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