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
8da88116
Commit
8da88116
authored
Sep 03, 2012
by
Rico Schüller
Committed by
Alexandre Julliard
Sep 03, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dx9: Remove PixelFormatDesc typedef.
parent
1a9413b9
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
34 additions
and
33 deletions
+34
-33
d3dx9_36_private.h
dlls/d3dx9_36/d3dx9_36_private.h
+8
-8
surface.c
dlls/d3dx9_36/surface.c
+17
-15
texture.c
dlls/d3dx9_36/texture.c
+5
-5
util.c
dlls/d3dx9_36/util.c
+3
-4
volume.c
dlls/d3dx9_36/volume.c
+1
-1
No files found.
dlls/d3dx9_36/d3dx9_36_private.h
View file @
8da88116
...
...
@@ -50,7 +50,7 @@ typedef enum _FormatType {
FORMAT_UNKNOWN
}
FormatType
;
typedef
struct
_PixelFormatD
esc
{
struct
pixel_format_d
esc
{
D3DFORMAT
format
;
BYTE
bits
[
4
];
BYTE
shift
[
4
];
...
...
@@ -61,21 +61,21 @@ typedef struct _PixelFormatDesc {
FormatType
type
;
void
(
*
from_rgba
)(
const
struct
vec4
*
src
,
struct
vec4
*
dst
);
void
(
*
to_rgba
)(
const
struct
vec4
*
src
,
struct
vec4
*
dst
);
}
PixelFormatDesc
;
};
HRESULT
map_view_of_file
(
LPCWSTR
filename
,
LPVOID
*
buffer
,
DWORD
*
length
)
DECLSPEC_HIDDEN
;
HRESULT
load_resource_into_memory
(
HMODULE
module
,
HRSRC
resinfo
,
LPVOID
*
buffer
,
DWORD
*
length
)
DECLSPEC_HIDDEN
;
HRESULT
write_buffer_to_file
(
const
WCHAR
*
filename
,
ID3DXBuffer
*
buffer
)
DECLSPEC_HIDDEN
;
const
PixelFormatD
esc
*
get_format_info
(
D3DFORMAT
format
)
DECLSPEC_HIDDEN
;
const
PixelFormatD
esc
*
get_format_info_idx
(
int
idx
)
DECLSPEC_HIDDEN
;
const
struct
pixel_format_d
esc
*
get_format_info
(
D3DFORMAT
format
)
DECLSPEC_HIDDEN
;
const
struct
pixel_format_d
esc
*
get_format_info_idx
(
int
idx
)
DECLSPEC_HIDDEN
;
void
copy_simple_data
(
const
BYTE
*
src
,
UINT
src_row_pitch
,
UINT
src_slice_pitch
,
struct
volume
*
src_size
,
const
PixelFormatD
esc
*
src_format
,
BYTE
*
dst
,
UINT
dst_row_pitch
,
UINT
dst_slice_pitch
,
struct
volume
*
dst_size
,
const
PixelFormatD
esc
*
dst_format
,
void
copy_simple_data
(
const
BYTE
*
src
,
UINT
src_row_pitch
,
UINT
src_slice_pitch
,
struct
volume
*
src_size
,
const
struct
pixel_format_d
esc
*
src_format
,
BYTE
*
dst
,
UINT
dst_row_pitch
,
UINT
dst_slice_pitch
,
struct
volume
*
dst_size
,
const
struct
pixel_format_d
esc
*
dst_format
,
D3DCOLOR
color_key
)
DECLSPEC_HIDDEN
;
void
point_filter_simple_data
(
const
BYTE
*
src
,
UINT
src_row_pitch
,
UINT
src_slice_pitch
,
struct
volume
*
src_size
,
const
PixelFormatD
esc
*
src_format
,
BYTE
*
dst
,
UINT
dst_row_pitch
,
UINT
dst_slice_pitch
,
struct
volume
*
dst_size
,
const
PixelFormatD
esc
*
dst_format
,
void
point_filter_simple_data
(
const
BYTE
*
src
,
UINT
src_row_pitch
,
UINT
src_slice_pitch
,
struct
volume
*
src_size
,
const
struct
pixel_format_d
esc
*
src_format
,
BYTE
*
dst
,
UINT
dst_row_pitch
,
UINT
dst_slice_pitch
,
struct
volume
*
dst_size
,
const
struct
pixel_format_d
esc
*
dst_format
,
D3DCOLOR
color_key
)
DECLSPEC_HIDDEN
;
HRESULT
load_texture_from_dds
(
IDirect3DTexture9
*
texture
,
const
void
*
src_data
,
const
PALETTEENTRY
*
palette
,
...
...
dlls/d3dx9_36/surface.c
View file @
8da88116
...
...
@@ -278,7 +278,7 @@ static D3DFORMAT dds_pixel_format_to_d3dformat(const struct dds_pixel_format *pi
static
HRESULT
calculate_dds_surface_size
(
const
D3DXIMAGE_INFO
*
img_info
,
UINT
width
,
UINT
height
,
UINT
*
pitch
,
UINT
*
size
)
{
const
PixelFormatD
esc
*
format_desc
=
get_format_info
(
img_info
->
Format
);
const
struct
pixel_format_d
esc
*
format_desc
=
get_format_info
(
img_info
->
Format
);
if
(
format_desc
->
format
==
D3DFMT_UNKNOWN
)
return
E_NOTIMPL
;
...
...
@@ -854,7 +854,7 @@ HRESULT WINAPI D3DXLoadSurfaceFromFileInMemory(IDirect3DSurface9 *pDestSurface,
IWICBitmapFrameDecode
*
bitmapframe
;
IWICStream
*
stream
;
const
PixelFormatD
esc
*
formatdesc
;
const
struct
pixel_format_d
esc
*
formatdesc
;
WICRect
wicrect
;
RECT
rect
;
...
...
@@ -1097,15 +1097,15 @@ HRESULT WINAPI D3DXLoadSurfaceFromResourceW(IDirect3DSurface9 *dst_surface,
*/
struct
argb_conversion_info
{
CONST
PixelFormatD
esc
*
srcformat
;
CONST
PixelFormatD
esc
*
destformat
;
const
struct
pixel_format_d
esc
*
srcformat
;
const
struct
pixel_format_d
esc
*
destformat
;
DWORD
srcshift
[
4
],
destshift
[
4
];
DWORD
srcmask
[
4
],
destmask
[
4
];
BOOL
process_channel
[
4
];
DWORD
channelmask
;
};
static
void
init_argb_conversion_info
(
CONST
PixelFormatDesc
*
srcformat
,
CONST
PixelFormatD
esc
*
destformat
,
struct
argb_conversion_info
*
info
)
static
void
init_argb_conversion_info
(
const
struct
pixel_format_desc
*
srcformat
,
const
struct
pixel_format_d
esc
*
destformat
,
struct
argb_conversion_info
*
info
)
{
UINT
i
;
ZeroMemory
(
info
->
process_channel
,
4
*
sizeof
(
BOOL
));
...
...
@@ -1196,7 +1196,7 @@ static DWORD make_argb_color(CONST struct argb_conversion_info *info, CONST DWOR
return
val
;
}
static
void
format_to_vec4
(
const
PixelFormatD
esc
*
format
,
const
DWORD
*
src
,
struct
vec4
*
dst
)
static
void
format_to_vec4
(
const
struct
pixel_format_d
esc
*
format
,
const
DWORD
*
src
,
struct
vec4
*
dst
)
{
DWORD
mask
;
...
...
@@ -1233,7 +1233,7 @@ static void format_to_vec4(const PixelFormatDesc *format, const DWORD *src, stru
dst
->
w
=
1
.
0
f
;
}
static
void
format_from_vec4
(
const
PixelFormatD
esc
*
format
,
const
struct
vec4
*
src
,
DWORD
*
dst
)
static
void
format_from_vec4
(
const
struct
pixel_format_d
esc
*
format
,
const
struct
vec4
*
src
,
DWORD
*
dst
)
{
*
dst
=
0
;
...
...
@@ -1255,11 +1255,12 @@ static void format_from_vec4(const PixelFormatDesc *format, const struct vec4 *s
* Pixels outsize the source rect are blacked out.
* Works only for ARGB formats with 1 - 4 bytes per pixel.
*/
void
copy_simple_data
(
const
BYTE
*
src
,
UINT
src_row_pitch
,
UINT
src_slice_pitch
,
struct
volume
*
src_size
,
const
PixelFormatDesc
*
src_format
,
BYTE
*
dst
,
UINT
dst_row_pitch
,
UINT
dst_slice_pitch
,
struct
volume
*
dst_size
,
const
PixelFormatDesc
*
dst_format
,
D3DCOLOR
color_key
)
void
copy_simple_data
(
const
BYTE
*
src
,
UINT
src_row_pitch
,
UINT
src_slice_pitch
,
struct
volume
*
src_size
,
const
struct
pixel_format_desc
*
src_format
,
BYTE
*
dst
,
UINT
dst_row_pitch
,
UINT
dst_slice_pitch
,
struct
volume
*
dst_size
,
const
struct
pixel_format_desc
*
dst_format
,
D3DCOLOR
color_key
)
{
struct
argb_conversion_info
conv_info
,
ck_conv_info
;
const
PixelFormatD
esc
*
ck_format
=
NULL
;
const
struct
pixel_format_d
esc
*
ck_format
=
NULL
;
DWORD
channels
[
4
],
pixel
;
UINT
min_width
,
min_height
,
min_depth
;
UINT
x
,
y
,
z
;
...
...
@@ -1353,11 +1354,12 @@ void copy_simple_data(const BYTE *src, UINT src_row_pitch, UINT src_slice_pitch,
* using a point filter.
* Works only for ARGB formats with 1 - 4 bytes per pixel.
*/
void
point_filter_simple_data
(
const
BYTE
*
src
,
UINT
src_row_pitch
,
UINT
src_slice_pitch
,
struct
volume
*
src_size
,
const
PixelFormatDesc
*
src_format
,
BYTE
*
dst
,
UINT
dst_row_pitch
,
UINT
dst_slice_pitch
,
struct
volume
*
dst_size
,
const
PixelFormatDesc
*
dst_format
,
D3DCOLOR
color_key
)
void
point_filter_simple_data
(
const
BYTE
*
src
,
UINT
src_row_pitch
,
UINT
src_slice_pitch
,
struct
volume
*
src_size
,
const
struct
pixel_format_desc
*
src_format
,
BYTE
*
dst
,
UINT
dst_row_pitch
,
UINT
dst_slice_pitch
,
struct
volume
*
dst_size
,
const
struct
pixel_format_desc
*
dst_format
,
D3DCOLOR
color_key
)
{
struct
argb_conversion_info
conv_info
,
ck_conv_info
;
const
PixelFormatD
esc
*
ck_format
=
NULL
;
const
struct
pixel_format_d
esc
*
ck_format
=
NULL
;
DWORD
channels
[
4
],
pixel
;
UINT
x
,
y
,
z
;
...
...
@@ -1471,7 +1473,7 @@ HRESULT WINAPI D3DXLoadSurfaceFromMemory(IDirect3DSurface9 *dst_surface,
D3DFORMAT
src_format
,
UINT
src_pitch
,
const
PALETTEENTRY
*
src_palette
,
const
RECT
*
src_rect
,
DWORD
filter
,
D3DCOLOR
color_key
)
{
CONST
PixelFormatD
esc
*
srcformatdesc
,
*
destformatdesc
;
const
struct
pixel_format_d
esc
*
srcformatdesc
,
*
destformatdesc
;
D3DSURFACE_DESC
surfdesc
;
D3DLOCKED_RECT
lockrect
;
struct
volume
src_size
,
dst_size
;
...
...
@@ -1839,7 +1841,7 @@ HRESULT WINAPI D3DXSaveSurfaceToFileInMemory(ID3DXBuffer **dst_buffer, D3DXIMAGE
}
else
/* Pixel format conversion */
{
const
PixelFormatD
esc
*
src_format_desc
,
*
dst_format_desc
;
const
struct
pixel_format_d
esc
*
src_format_desc
,
*
dst_format_desc
;
struct
volume
size
;
DWORD
dst_pitch
;
void
*
dst_data
;
...
...
dlls/d3dx9_36/texture.c
View file @
8da88116
...
...
@@ -314,11 +314,11 @@ HRESULT WINAPI D3DXCheckTextureRequirements(LPDIRECT3DDEVICE9 device,
if
(
FAILED
(
hr
))
{
/* Heuristic to choose the fallback format */
const
PixelFormatD
esc
*
fmt
=
get_format_info
(
usedformat
);
const
struct
pixel_format_d
esc
*
fmt
=
get_format_info
(
usedformat
);
BOOL
allow_24bits
;
int
bestscore
=
INT_MIN
,
i
=
0
,
j
;
unsigned
int
channels
;
const
PixelFormatD
esc
*
curfmt
;
const
struct
pixel_format_d
esc
*
curfmt
;
if
(
!
fmt
)
{
...
...
@@ -1328,7 +1328,7 @@ HRESULT WINAPI D3DXFillTexture(LPDIRECT3DTEXTURE9 texture,
D3DLOCKED_RECT
lock_rect
;
D3DXVECTOR4
value
;
D3DXVECTOR2
coord
,
size
;
const
PixelFormatD
esc
*
format
;
const
struct
pixel_format_d
esc
*
format
;
BYTE
*
data
,
*
pos
;
BYTE
byte
,
mask
;
float
comp_value
;
...
...
@@ -1721,7 +1721,7 @@ HRESULT WINAPI D3DXFillCubeTexture(LPDIRECT3DCUBETEXTURE9 texture,
D3DLOCKED_RECT
lock_rect
;
D3DXVECTOR4
value
;
D3DXVECTOR3
coord
,
size
;
const
PixelFormatD
esc
*
format
;
const
struct
pixel_format_d
esc
*
format
;
BYTE
*
data
,
*
pos
;
BYTE
byte
,
mask
;
float
comp_value
;
...
...
@@ -1824,7 +1824,7 @@ HRESULT WINAPI D3DXFillVolumeTexture(LPDIRECT3DVOLUMETEXTURE9 texture,
D3DLOCKED_BOX
lock_box
;
D3DXVECTOR4
value
;
D3DXVECTOR3
coord
,
size
;
const
PixelFormatD
esc
*
format
;
const
struct
pixel_format_d
esc
*
format
;
BYTE
*
data
,
*
pos
;
BYTE
byte
,
mask
;
float
comp_value
;
...
...
dlls/d3dx9_36/util.c
View file @
8da88116
...
...
@@ -42,7 +42,7 @@ static void la_to_rgba(const struct vec4 *la, struct vec4 *rgba)
*
* Call get_format_info to request information about a specific format.
*/
static
const
PixelFormatD
esc
formats
[]
=
static
const
struct
pixel_format_d
esc
formats
[]
=
{
/* format bpc shifts bpp blocks type from_rgba to_rgba */
{
D3DFMT_R8G8B8
,
{
0
,
8
,
8
,
8
},
{
0
,
16
,
8
,
0
},
3
,
1
,
1
,
3
,
FORMAT_ARGB
,
NULL
,
NULL
},
...
...
@@ -186,10 +186,9 @@ HRESULT write_buffer_to_file(const WCHAR *dst_filename, ID3DXBuffer *buffer)
*
* PARAMS
* format [I] format whose description is queried
* desc [O] pointer to a StaticPixelFormatDesc structure
*
*/
const
PixelFormatD
esc
*
get_format_info
(
D3DFORMAT
format
)
const
struct
pixel_format_d
esc
*
get_format_info
(
D3DFORMAT
format
)
{
unsigned
int
i
=
0
;
while
(
formats
[
i
].
format
!=
format
&&
formats
[
i
].
format
!=
D3DFMT_UNKNOWN
)
i
++
;
...
...
@@ -198,7 +197,7 @@ const PixelFormatDesc *get_format_info(D3DFORMAT format)
return
&
formats
[
i
];
}
const
PixelFormatD
esc
*
get_format_info_idx
(
int
idx
)
const
struct
pixel_format_d
esc
*
get_format_info_idx
(
int
idx
)
{
if
(
idx
>=
sizeof
(
formats
)
/
sizeof
(
formats
[
0
]))
return
NULL
;
...
...
dlls/d3dx9_36/volume.c
View file @
8da88116
...
...
@@ -96,7 +96,7 @@ HRESULT WINAPI D3DXLoadVolumeFromMemory(IDirect3DVolume9 *dst_volume,
D3DVOLUME_DESC
desc
;
D3DLOCKED_BOX
locked_box
;
struct
volume
dst_size
,
src_size
;
const
PixelFormatD
esc
*
src_format_desc
,
*
dst_format_desc
;
const
struct
pixel_format_d
esc
*
src_format_desc
,
*
dst_format_desc
;
TRACE
(
"(%p, %p, %p, %p, %#x, %u, %u, %p, %p, %x, %x)
\n
"
,
dst_volume
,
dst_palette
,
dst_box
,
src_memory
,
src_format
,
src_row_pitch
,
src_slice_pitch
,
src_palette
,
src_box
,
...
...
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