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
277040d9
Commit
277040d9
authored
Aug 04, 2010
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dx9: Fix some incorrect const typecasts.
parent
1905e93b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
16 deletions
+13
-16
surface.c
dlls/d3dx9_36/surface.c
+13
-16
No files found.
dlls/d3dx9_36/surface.c
View file @
277040d9
...
...
@@ -529,13 +529,11 @@ static void make_argb_color(CONST struct argb_conversion_info *info, CONST DWORD
* Works only for ARGB formats with 1 - 4 bytes per pixel.
*/
static
void
copy_simple_data
(
CONST
BYTE
*
src
,
UINT
srcpitch
,
POINT
srcsize
,
CONST
PixelFormatDesc
*
srcformat
,
CONST
BYTE
*
dest
,
UINT
destpitch
,
POINT
destsize
,
CONST
PixelFormatDesc
*
destformat
)
BYTE
*
dest
,
UINT
destpitch
,
POINT
destsize
,
CONST
PixelFormatDesc
*
destformat
)
{
struct
argb_conversion_info
conv_info
;
DWORD
channels
[
4
];
UINT
minwidth
,
minheight
;
BYTE
*
srcptr
,
*
destptr
;
UINT
x
,
y
;
ZeroMemory
(
channels
,
sizeof
(
channels
));
...
...
@@ -545,11 +543,11 @@ static void copy_simple_data(CONST BYTE *src, UINT srcpitch, POINT srcsize, C
minheight
=
(
srcsize
.
y
<
destsize
.
y
)
?
srcsize
.
y
:
destsize
.
y
;
for
(
y
=
0
;
y
<
minheight
;
y
++
)
{
srcptr
=
(
BYTE
*
)(
src
+
y
*
srcpitch
)
;
destptr
=
(
BYTE
*
)(
dest
+
y
*
destpitch
)
;
const
BYTE
*
srcptr
=
src
+
y
*
srcpitch
;
BYTE
*
destptr
=
dest
+
y
*
destpitch
;
for
(
x
=
0
;
x
<
minwidth
;
x
++
)
{
/* extract source color components */
if
(
srcformat
->
type
==
FORMAT_ARGB
)
get_relevant_argb_components
(
&
conv_info
,
*
(
DWORD
*
)
srcptr
,
channels
);
if
(
srcformat
->
type
==
FORMAT_ARGB
)
get_relevant_argb_components
(
&
conv_info
,
*
(
const
DWORD
*
)
srcptr
,
channels
);
/* recombine the components */
if
(
destformat
->
type
==
FORMAT_ARGB
)
make_argb_color
(
&
conv_info
,
channels
,
(
DWORD
*
)
destptr
);
...
...
@@ -570,13 +568,12 @@ static void copy_simple_data(CONST BYTE *src, UINT srcpitch, POINT srcsize, C
* Works only for ARGB formats with 1 - 4 bytes per pixel.
*/
static
void
point_filter_simple_data
(
CONST
BYTE
*
src
,
UINT
srcpitch
,
POINT
srcsize
,
CONST
PixelFormatDesc
*
srcformat
,
CONST
BYTE
*
dest
,
UINT
destpitch
,
POINT
destsize
,
CONST
PixelFormatDesc
*
destformat
)
BYTE
*
dest
,
UINT
destpitch
,
POINT
destsize
,
CONST
PixelFormatDesc
*
destformat
)
{
struct
argb_conversion_info
conv_info
;
DWORD
channels
[
4
];
UINT
minwidth
,
minheight
;
BYTE
*
srcptr
,
*
destptr
,
*
bufptr
;
UINT
x
,
y
;
ZeroMemory
(
channels
,
sizeof
(
channels
));
...
...
@@ -586,13 +583,13 @@ static void point_filter_simple_data(CONST BYTE *src, UINT srcpitch, POINT sr
minheight
=
(
srcsize
.
y
<
destsize
.
y
)
?
srcsize
.
y
:
destsize
.
y
;
for
(
y
=
0
;
y
<
destsize
.
y
;
y
++
)
{
destptr
=
(
BYTE
*
)
dest
+
y
*
destpitch
;
bufptr
=
(
BYTE
*
)
src
+
srcpitch
*
(
y
*
srcsize
.
y
/
destsize
.
y
);
srcptr
=
bufptr
;
BYTE
*
destptr
=
dest
+
y
*
destpitch
;
const
BYTE
*
bufptr
=
src
+
srcpitch
*
(
y
*
srcsize
.
y
/
destsize
.
y
);
const
BYTE
*
srcptr
=
bufptr
;
for
(
x
=
0
;
x
<
destsize
.
x
;
x
++
)
{
/* extract source color components */
if
(
srcformat
->
type
==
FORMAT_ARGB
)
get_relevant_argb_components
(
&
conv_info
,
*
(
DWORD
*
)
srcptr
,
channels
);
if
(
srcformat
->
type
==
FORMAT_ARGB
)
get_relevant_argb_components
(
&
conv_info
,
*
(
const
DWORD
*
)
srcptr
,
channels
);
/* recombine the components */
if
(
destformat
->
type
==
FORMAT_ARGB
)
make_argb_color
(
&
conv_info
,
channels
,
(
DWORD
*
)
destptr
);
...
...
@@ -685,12 +682,12 @@ HRESULT WINAPI D3DXLoadSurfaceFromMemory(LPDIRECT3DSURFACE9 pDestSurface,
if
(
FAILED
(
hr
))
return
D3DXERR_INVALIDDATA
;
if
((
dwFilter
&
0xF
)
==
D3DX_FILTER_NONE
)
{
copy_simple_data
(
(
CONST
BYTE
*
)
pSrcMemory
,
SrcPitch
,
srcsize
,
srcformatdesc
,
(
CONST
BYTE
*
)
lockrect
.
pBits
,
lockrect
.
Pitch
,
destsize
,
destformatdesc
);
copy_simple_data
(
pSrcMemory
,
SrcPitch
,
srcsize
,
srcformatdesc
,
lockrect
.
pBits
,
lockrect
.
Pitch
,
destsize
,
destformatdesc
);
}
else
/*if((dwFilter & 0xF) == D3DX_FILTER_POINT) */
{
/* always apply a point filter until D3DX_FILTER_LINEAR, D3DX_FILTER_TRIANGLE and D3DX_FILTER_BOX are implemented */
point_filter_simple_data
(
(
CONST
BYTE
*
)
pSrcMemory
,
SrcPitch
,
srcsize
,
srcformatdesc
,
(
CONST
BYTE
*
)
lockrect
.
pBits
,
lockrect
.
Pitch
,
destsize
,
destformatdesc
);
point_filter_simple_data
(
pSrcMemory
,
SrcPitch
,
srcsize
,
srcformatdesc
,
lockrect
.
pBits
,
lockrect
.
Pitch
,
destsize
,
destformatdesc
);
}
IDirect3DSurface9_UnlockRect
(
pDestSurface
);
...
...
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