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
4c87bc0c
Commit
4c87bc0c
authored
Apr 14, 2010
by
Roderick Colenbrander
Committed by
Alexandre Julliard
Apr 14, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Move A4L4 conversion to the formats table.
parent
cda78c01
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
29 deletions
+25
-29
surface.c
dlls/wined3d/surface.c
+0
-27
utils.c
dlls/wined3d/utils.c
+25
-2
No files found.
dlls/wined3d/surface.c
View file @
4c87bc0c
...
@@ -2223,15 +2223,6 @@ HRESULT d3dfmt_get_conv(IWineD3DSurfaceImpl *This, BOOL need_alpha_ck, BOOL use_
...
@@ -2223,15 +2223,6 @@ HRESULT d3dfmt_get_conv(IWineD3DSurfaceImpl *This, BOOL need_alpha_ck, BOOL use_
}
}
break
;
break
;
case
WINED3DFMT_L4A4_UNORM
:
/* WINED3DFMT_L4A4_UNORM exists as an internal gl format, but for some reason there is not
* format+type combination to load it. Thus convert it to A8L8, then load it
* with A4L4 internal, but A8L8 format+type
*/
*
convert
=
CONVERT_A4L4
;
desc
->
conv_byte_count
=
2
;
break
;
default:
default:
break
;
break
;
}
}
...
@@ -2475,24 +2466,6 @@ static HRESULT d3dfmt_convert_surface(const BYTE *src, BYTE *dst, UINT pitch, UI
...
@@ -2475,24 +2466,6 @@ static HRESULT d3dfmt_convert_surface(const BYTE *src, BYTE *dst, UINT pitch, UI
}
}
break
;
break
;
case
CONVERT_A4L4
:
{
unsigned
int
x
,
y
;
const
unsigned
char
*
Source
;
unsigned
char
*
Dest
;
for
(
y
=
0
;
y
<
height
;
y
++
)
{
Source
=
src
+
y
*
pitch
;
Dest
=
dst
+
y
*
outpitch
;
for
(
x
=
0
;
x
<
width
;
x
++
)
{
unsigned
char
color
=
(
*
Source
++
);
/* A */
Dest
[
1
]
=
(
color
&
0xf0
)
<<
0
;
/* L */
Dest
[
0
]
=
(
color
&
0x0f
)
<<
4
;
Dest
+=
2
;
}
}
break
;
}
default:
default:
ERR
(
"Unsupported conversion type %#x.
\n
"
,
convert
);
ERR
(
"Unsupported conversion type %#x.
\n
"
,
convert
);
}
}
...
...
dlls/wined3d/utils.c
View file @
4c87bc0c
...
@@ -241,6 +241,29 @@ struct wined3d_format_texture_info
...
@@ -241,6 +241,29 @@ struct wined3d_format_texture_info
void
(
*
convert
)(
const
BYTE
*
src
,
BYTE
*
dst
,
UINT
pitch
,
UINT
width
,
UINT
height
);
void
(
*
convert
)(
const
BYTE
*
src
,
BYTE
*
dst
,
UINT
pitch
,
UINT
width
,
UINT
height
);
};
};
static
void
convert_l4a4_unorm
(
const
BYTE
*
src
,
BYTE
*
dst
,
UINT
pitch
,
UINT
width
,
UINT
height
)
{
/* WINED3DFMT_L4A4_UNORM exists as an internal gl format, but for some reason there is not
* format+type combination to load it. Thus convert it to A8L8, then load it
* with A4L4 internal, but A8L8 format+type
*/
unsigned
int
x
,
y
;
const
unsigned
char
*
Source
;
unsigned
char
*
Dest
;
UINT
outpitch
=
pitch
*
2
;
for
(
y
=
0
;
y
<
height
;
y
++
)
{
Source
=
src
+
y
*
pitch
;
Dest
=
dst
+
y
*
outpitch
;
for
(
x
=
0
;
x
<
width
;
x
++
)
{
unsigned
char
color
=
(
*
Source
++
);
/* A */
Dest
[
1
]
=
(
color
&
0xf0
)
<<
0
;
/* L */
Dest
[
0
]
=
(
color
&
0x0f
)
<<
4
;
Dest
+=
2
;
}
}
}
static
void
convert_r5g5_snorm_l6_unorm
(
const
BYTE
*
src
,
BYTE
*
dst
,
UINT
pitch
,
UINT
width
,
UINT
height
)
static
void
convert_r5g5_snorm_l6_unorm
(
const
BYTE
*
src
,
BYTE
*
dst
,
UINT
pitch
,
UINT
width
,
UINT
height
)
{
{
unsigned
int
x
,
y
;
unsigned
int
x
,
y
;
...
@@ -703,9 +726,9 @@ static const struct wined3d_format_texture_info format_texture_info[] =
...
@@ -703,9 +726,9 @@ static const struct wined3d_format_texture_info format_texture_info[] =
WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING
|
WINED3DFMT_FLAG_FILTERING
,
WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING
|
WINED3DFMT_FLAG_FILTERING
,
WINED3D_GL_EXT_NONE
,
NULL
},
WINED3D_GL_EXT_NONE
,
NULL
},
{
WINED3DFMT_L4A4_UNORM
,
GL_LUMINANCE4_ALPHA4
,
GL_LUMINANCE4_ALPHA4
,
0
,
{
WINED3DFMT_L4A4_UNORM
,
GL_LUMINANCE4_ALPHA4
,
GL_LUMINANCE4_ALPHA4
,
0
,
GL_LUMINANCE_ALPHA
,
GL_UNSIGNED_BYTE
,
0
,
GL_LUMINANCE_ALPHA
,
GL_UNSIGNED_BYTE
,
2
,
0
,
0
,
WINED3D_GL_EXT_NONE
,
NULL
},
WINED3D_GL_EXT_NONE
,
&
convert_l4a4_unorm
},
/* Bump mapping stuff */
/* Bump mapping stuff */
{
WINED3DFMT_R8G8_SNORM
,
GL_RGB8
,
GL_RGB8
,
0
,
{
WINED3DFMT_R8G8_SNORM
,
GL_RGB8
,
GL_RGB8
,
0
,
GL_BGR
,
GL_UNSIGNED_BYTE
,
3
,
GL_BGR
,
GL_UNSIGNED_BYTE
,
3
,
...
...
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