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
0ed81b20
Commit
0ed81b20
authored
Aug 31, 2007
by
Stefan Dösinger
Committed by
Alexandre Julliard
Sep 12, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Emulate D3DFMT_L6V5U5.
parent
9ef52315
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
56 additions
and
1 deletion
+56
-1
surface.c
dlls/wined3d/surface.c
+54
-0
utils.c
dlls/wined3d/utils.c
+1
-1
wined3d_private.h
dlls/wined3d/wined3d_private.h
+1
-0
No files found.
dlls/wined3d/surface.c
View file @
0ed81b20
...
...
@@ -1576,6 +1576,20 @@ HRESULT d3dfmt_get_conv(IWineD3DSurfaceImpl *This, BOOL need_alpha_ck, BOOL use_
*
target_bpp
=
3
;
break
;
case
WINED3DFMT_L6V5U5
:
*
convert
=
CONVERT_L6V5U5
;
if
(
GL_SUPPORT
(
NV_TEXTURE_SHADER
))
{
*
target_bpp
=
3
;
/* Use format and types from table */
}
else
{
/* Load it into unsigned R5G6B5, swap L and V channels, and revert that in the shader */
*
target_bpp
=
2
;
*
format
=
GL_RGB
;
*
internal
=
GL_RGB5
;
*
type
=
GL_UNSIGNED_SHORT_5_6_5
;
}
break
;
case
WINED3DFMT_X8L8V8U8
:
*
convert
=
CONVERT_X8L8V8U8
;
*
target_bpp
=
4
;
...
...
@@ -1838,6 +1852,46 @@ HRESULT d3dfmt_convert_surface(BYTE *src, BYTE *dst, UINT pitch, UINT width, UIN
break
;
}
case
CONVERT_L6V5U5
:
{
unsigned
int
x
,
y
;
WORD
*
Source
;
unsigned
char
*
Dest
;
if
(
GL_SUPPORT
(
NV_TEXTURE_SHADER
))
{
/* This makes the gl surface bigger(24 bit instead of 16), but it works with
* fixed function and shaders without further conversion once the surface is
* loaded
*/
for
(
y
=
0
;
y
<
height
;
y
++
)
{
Source
=
(
WORD
*
)
(
src
+
y
*
pitch
);
Dest
=
(
unsigned
char
*
)
(
dst
+
y
*
outpitch
);
for
(
x
=
0
;
x
<
width
;
x
++
)
{
short
color
=
(
*
Source
++
);
unsigned
char
l
=
((
color
>>
10
)
&
0xfc
);
char
v
=
((
color
>>
5
)
&
0x3e
);
char
u
=
((
color
)
&
0x1f
);
/* 8 bits destination, 6 bits source, 8th bit is the sign. gl ignores the sign
* and doubles the positive range. Thus shift left only once, gl does the 2nd
* shift. GL reads a signed value and converts it into an unsigned value.
*/
/* M */
Dest
[
2
]
=
l
<<
1
;
/* Those are read as signed, but kept signed. Just left-shift 3 times to scale
* from 5 bit values to 8 bit values.
*/
/* V */
Dest
[
1
]
=
v
<<
3
;
/* U */
Dest
[
0
]
=
u
<<
3
;
Dest
+=
3
;
}
}
}
else
{
FIXME
(
"Add D3DFMT_L6V5U5 emulation using standard unsigned RGB and shaders
\n
"
);
}
break
;
}
case
CONVERT_X8L8V8U8
:
{
unsigned
int
x
,
y
;
...
...
dlls/wined3d/utils.c
View file @
0ed81b20
...
...
@@ -169,7 +169,7 @@ static const GlPixelFormatDescTemplate gl_formats_template[] = {
{
WINED3DFMT_A4L4
,
GL_LUMINANCE4_ALPHA4
,
GL_LUMINANCE4_ALPHA4
,
GL_LUMINANCE_ALPHA
,
GL_UNSIGNED_BYTE
},
/* Bump mapping stuff */
{
WINED3DFMT_V8U8
,
GL_DSDT8_NV
,
GL_DSDT8_NV
,
GL_DSDT_NV
,
GL_BYTE
},
{
WINED3DFMT_L6V5U5
,
GL_
COLOR_INDEX8_EXT
,
GL_COLOR_INDEX8_EXT
,
GL_COLOR_INDEX
,
GL_UNSIGNED_SHORT_5_5_5_1
},
{
WINED3DFMT_L6V5U5
,
GL_
DSDT8_MAG8_NV
,
GL_DSDT8_MAG8_NV
,
GL_DSDT_MAG_NV
,
GL_BYTE
},
{
WINED3DFMT_X8L8V8U8
,
GL_DSDT8_MAG8_INTENSITY8_NV
,
GL_DSDT8_MAG8_INTENSITY8_NV
,
GL_DSDT_MAG_VIB_NV
,
GL_UNSIGNED_INT_8_8_S8_S8_REV_NV
},
{
WINED3DFMT_Q8W8V8U8
,
GL_SIGNED_RGBA8_NV
,
GL_SIGNED_RGBA8_NV
,
GL_RGBA
,
GL_BYTE
},
{
WINED3DFMT_V16U16
,
GL_SIGNED_HILO16_NV
,
GL_SIGNED_HILO16_NV
,
GL_HILO_NV
,
GL_SHORT
},
...
...
dlls/wined3d/wined3d_private.h
View file @
0ed81b20
...
...
@@ -1231,6 +1231,7 @@ typedef enum {
CONVERT_CK_8888_ARGB
,
CONVERT_RGB32_888
,
CONVERT_V8U8
,
CONVERT_L6V5U5
,
CONVERT_X8L8V8U8
,
CONVERT_Q8W8V8U8
,
CONVERT_V16U16
,
...
...
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