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
84935d43
Commit
84935d43
authored
Oct 22, 2012
by
Józef Kucia
Committed by
Alexandre Julliard
Oct 23, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dx9: Introduce a separate pixel format type for compressed pixel formats.
parent
cdc9f283
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
27 deletions
+17
-27
d3dx9_36_private.h
dlls/d3dx9_36/d3dx9_36_private.h
+1
-0
surface.c
dlls/d3dx9_36/surface.c
+10
-19
util.c
dlls/d3dx9_36/util.c
+5
-5
volume.c
dlls/d3dx9_36/volume.c
+1
-3
No files found.
dlls/d3dx9_36/d3dx9_36_private.h
View file @
84935d43
...
...
@@ -47,6 +47,7 @@ struct volume
/* for internal use */
enum
format_type
{
FORMAT_ARGB
,
/* unsigned */
FORMAT_DXT
,
FORMAT_UNKNOWN
};
...
...
dlls/d3dx9_36/surface.c
View file @
84935d43
...
...
@@ -307,7 +307,7 @@ static HRESULT calculate_dds_surface_size(D3DFORMAT format, UINT width, UINT hei
UINT
*
pitch
,
UINT
*
size
)
{
const
struct
pixel_format_desc
*
format_desc
=
get_format_info
(
format
);
if
(
format_desc
->
format
==
D3DFM
T_UNKNOWN
)
if
(
format_desc
->
type
==
FORMA
T_UNKNOWN
)
return
E_NOTIMPL
;
if
(
format_desc
->
block_width
!=
1
||
format_desc
->
block_height
!=
1
)
...
...
@@ -460,7 +460,11 @@ static HRESULT save_dds_surface_to_memory(ID3DXBuffer **dst_buffer, IDirect3DSur
if
(
FAILED
(
hr
))
return
hr
;
pixel_format
=
get_format_info
(
src_desc
.
Format
);
if
(
pixel_format
->
type
==
FORMAT_UNKNOWN
)
return
E_NOTIMPL
;
if
(
pixel_format
->
type
!=
FORMAT_ARGB
)
{
FIXME
(
"Unsupported pixel format %#x
\n
"
,
src_desc
.
Format
);
return
E_NOTIMPL
;
}
file_size
=
calculate_dds_file_size
(
src_desc
.
Format
,
src_desc
.
Width
,
src_desc
.
Height
,
1
,
1
,
1
);
...
...
@@ -1028,7 +1032,7 @@ HRESULT WINAPI D3DXLoadSurfaceFromFileInMemory(IDirect3DSurface9 *pDestSurface,
formatdesc
=
get_format_info
(
imginfo
.
Format
);
if
(
formatdesc
->
format
==
D3DFM
T_UNKNOWN
)
if
(
formatdesc
->
type
==
FORMA
T_UNKNOWN
)
{
FIXME
(
"Unsupported pixel format
\n
"
);
hr
=
D3DXERR_INVALIDDATA
;
...
...
@@ -1676,15 +1680,13 @@ HRESULT WINAPI D3DXLoadSurfaceFromMemory(IDirect3DSurface9 *dst_surface,
}
else
/* Stretching or format conversion. */
{
if
(
srcformatdesc
->
bytes_per_pixel
>
4
||
destformatdesc
->
bytes_per_pixel
>
4
||
srcformatdesc
->
block_height
!=
1
||
srcformatdesc
->
block_width
!=
1
||
destformatdesc
->
block_height
!=
1
||
destformatdesc
->
block_width
!=
1
)
if
(
srcformatdesc
->
type
!=
FORMAT_ARGB
||
destformatdesc
->
type
!=
FORMAT_ARGB
)
{
FIXME
(
"Format conversion missing %#x -> %#x
\n
"
,
src_format
,
surfdesc
.
Format
);
return
E_NOTIMPL
;
}
if
(
FAILED
(
hr
=
IDirect3DSurface9_LockRect
(
dst_surface
,
&
lockrect
,
dst_rect
,
0
)))
if
(
FAILED
(
IDirect3DSurface9_LockRect
(
dst_surface
,
&
lockrect
,
dst_rect
,
0
)))
return
D3DXERR_INVALIDDATA
;
if
((
filter
&
0xf
)
==
D3DX_FILTER_NONE
)
...
...
@@ -1952,7 +1954,7 @@ HRESULT WINAPI D3DXSaveSurfaceToFileInMemory(ID3DXBuffer **dst_buffer, D3DXIMAGE
src_format_desc
=
get_format_info
(
src_surface_desc
.
Format
);
dst_format_desc
=
get_format_info
(
d3d_pixel_format
);
if
(
src_format_desc
->
format
==
D3DFMT_UNKNOWN
||
dst_format_desc
->
format
==
D3DFMT_UNKNOWN
)
if
(
src_format_desc
->
type
!=
FORMAT_ARGB
||
dst_format_desc
->
type
!=
FORMAT_ARGB
)
{
FIXME
(
"Unsupported pixel format conversion %#x -> %#x
\n
"
,
src_surface_desc
.
Format
,
d3d_pixel_format
);
...
...
@@ -1960,17 +1962,6 @@ HRESULT WINAPI D3DXSaveSurfaceToFileInMemory(ID3DXBuffer **dst_buffer, D3DXIMAGE
goto
cleanup
;
}
if
(
src_format_desc
->
bytes_per_pixel
>
4
||
dst_format_desc
->
bytes_per_pixel
>
4
||
src_format_desc
->
block_height
!=
1
||
src_format_desc
->
block_width
!=
1
||
dst_format_desc
->
block_height
!=
1
||
dst_format_desc
->
block_width
!=
1
)
{
FIXME
(
"Format conversion missing %#x -> %#x
\n
"
,
src_surface_desc
.
Format
,
d3d_pixel_format
);
hr
=
E_NOTIMPL
;
goto
cleanup
;
}
size
.
width
=
width
;
size
.
height
=
height
;
size
.
depth
=
1
;
...
...
dlls/d3dx9_36/util.c
View file @
84935d43
...
...
@@ -65,11 +65,11 @@ static const struct pixel_format_desc formats[] =
{
D3DFMT_A4L4
,
{
4
,
4
,
0
,
0
},
{
4
,
0
,
0
,
0
},
1
,
1
,
1
,
1
,
FORMAT_ARGB
,
la_from_rgba
,
la_to_rgba
},
{
D3DFMT_L8
,
{
0
,
8
,
0
,
0
},
{
0
,
0
,
0
,
0
},
1
,
1
,
1
,
1
,
FORMAT_ARGB
,
la_from_rgba
,
la_to_rgba
},
{
D3DFMT_L16
,
{
0
,
16
,
0
,
0
},
{
0
,
0
,
0
,
0
},
2
,
1
,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0
,
0
,
0
,
0
},
0
,
1
,
1
,
0
,
FORMAT_UNKNOWN
,
NULL
,
NULL
},
};
...
...
dlls/d3dx9_36/volume.c
View file @
84935d43
...
...
@@ -195,9 +195,7 @@ HRESULT WINAPI D3DXLoadVolumeFromMemory(IDirect3DVolume9 *dst_volume,
{
const
BYTE
*
src_addr
;
if
(
src_format_desc
->
bytes_per_pixel
>
4
||
dst_format_desc
->
bytes_per_pixel
>
4
||
src_format_desc
->
block_height
!=
1
||
src_format_desc
->
block_width
!=
1
||
dst_format_desc
->
block_height
!=
1
||
dst_format_desc
->
block_width
!=
1
)
if
(
src_format_desc
->
type
!=
FORMAT_ARGB
||
dst_format_desc
->
type
!=
FORMAT_ARGB
)
{
FIXME
(
"Pixel format conversion not implemented %#x -> %#x
\n
"
,
src_format_desc
->
format
,
dst_format_desc
->
format
);
...
...
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