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
26914eb3
Commit
26914eb3
authored
Sep 14, 2012
by
Rico Schüller
Committed by
Alexandre Julliard
Sep 14, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dx9: Use set_number instead of get_bool/int/float.
parent
ef003f0f
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
14 deletions
+14
-14
d3dx9_36_private.h
dlls/d3dx9_36/d3dx9_36_private.h
+0
-3
effect.c
dlls/d3dx9_36/effect.c
+11
-8
util.c
dlls/d3dx9_36/util.c
+3
-3
No files found.
dlls/d3dx9_36/d3dx9_36_private.h
View file @
26914eb3
...
@@ -94,9 +94,6 @@ const char *debug_d3dxparameter_type(D3DXPARAMETER_TYPE t) DECLSPEC_HIDDEN;
...
@@ -94,9 +94,6 @@ const char *debug_d3dxparameter_type(D3DXPARAMETER_TYPE t) DECLSPEC_HIDDEN;
const
char
*
debug_d3dxparameter_registerset
(
D3DXREGISTER_SET
r
)
DECLSPEC_HIDDEN
;
const
char
*
debug_d3dxparameter_registerset
(
D3DXREGISTER_SET
r
)
DECLSPEC_HIDDEN
;
/* parameter type conversion helpers */
/* parameter type conversion helpers */
INT
get_int
(
D3DXPARAMETER_TYPE
type
,
LPCVOID
data
)
DECLSPEC_HIDDEN
;
FLOAT
get_float
(
D3DXPARAMETER_TYPE
type
,
LPCVOID
data
)
DECLSPEC_HIDDEN
;
BOOL
get_bool
(
LPCVOID
data
)
DECLSPEC_HIDDEN
;
void
set_number
(
LPVOID
outdata
,
D3DXPARAMETER_TYPE
outtype
,
LPCVOID
indata
,
D3DXPARAMETER_TYPE
intype
)
DECLSPEC_HIDDEN
;
void
set_number
(
LPVOID
outdata
,
D3DXPARAMETER_TYPE
outtype
,
LPCVOID
indata
,
D3DXPARAMETER_TYPE
intype
)
DECLSPEC_HIDDEN
;
#endif
/* __WINE_D3DX9_36_PRIVATE_H */
#endif
/* __WINE_D3DX9_36_PRIVATE_H */
dlls/d3dx9_36/effect.c
View file @
26914eb3
...
@@ -853,7 +853,10 @@ static void get_vector(struct d3dx_parameter *param, D3DXVECTOR4 *vector)
...
@@ -853,7 +853,10 @@ static void get_vector(struct d3dx_parameter *param, D3DXVECTOR4 *vector)
for
(
i
=
0
;
i
<
4
;
++
i
)
for
(
i
=
0
;
i
<
4
;
++
i
)
{
{
((
FLOAT
*
)
vector
)[
i
]
=
i
<
param
->
columns
?
get_float
(
param
->
type
,
(
DWORD
*
)
param
->
data
+
i
)
:
0
.
0
f
;
if
(
i
<
param
->
columns
)
set_number
((
FLOAT
*
)
vector
+
i
,
D3DXPT_FLOAT
,
(
DWORD
*
)
param
->
data
+
i
,
param
->
type
);
else
((
FLOAT
*
)
vector
)[
i
]
=
0
.
0
f
;
}
}
}
}
...
@@ -876,7 +879,7 @@ static void get_matrix(struct d3dx_parameter *param, D3DXMATRIX *matrix)
...
@@ -876,7 +879,7 @@ static void get_matrix(struct d3dx_parameter *param, D3DXMATRIX *matrix)
for
(
k
=
0
;
k
<
4
;
++
k
)
for
(
k
=
0
;
k
<
4
;
++
k
)
{
{
if
((
i
<
param
->
rows
)
&&
(
k
<
param
->
columns
))
if
((
i
<
param
->
rows
)
&&
(
k
<
param
->
columns
))
matrix
->
u
.
m
[
i
][
k
]
=
get_float
(
param
->
type
,
(
FLOAT
*
)
param
->
data
+
i
*
param
->
columns
+
k
);
set_number
((
FLOAT
*
)
&
matrix
->
u
.
m
[
i
][
k
],
D3DXPT_FLOAT
,
(
DWORD
*
)
param
->
data
+
i
*
param
->
columns
+
k
,
param
->
type
);
else
else
matrix
->
u
.
m
[
i
][
k
]
=
0
.
0
f
;
matrix
->
u
.
m
[
i
][
k
]
=
0
.
0
f
;
}
}
...
@@ -1667,7 +1670,7 @@ static HRESULT WINAPI ID3DXBaseEffectImpl_GetBool(ID3DXBaseEffect *iface, D3DXHA
...
@@ -1667,7 +1670,7 @@ static HRESULT WINAPI ID3DXBaseEffectImpl_GetBool(ID3DXBaseEffect *iface, D3DXHA
if
(
b
&&
param
&&
!
param
->
element_count
&&
param
->
rows
==
1
&&
param
->
columns
==
1
)
if
(
b
&&
param
&&
!
param
->
element_count
&&
param
->
rows
==
1
&&
param
->
columns
==
1
)
{
{
*
b
=
get_bool
(
param
->
data
);
set_number
(
b
,
D3DXPT_BOOL
,
param
->
data
,
param
->
type
);
TRACE
(
"Returning %s
\n
"
,
*
b
?
"TRUE"
:
"FALSE"
);
TRACE
(
"Returning %s
\n
"
,
*
b
?
"TRUE"
:
"FALSE"
);
return
D3D_OK
;
return
D3D_OK
;
}
}
...
@@ -1733,7 +1736,7 @@ static HRESULT WINAPI ID3DXBaseEffectImpl_GetBoolArray(ID3DXBaseEffect *iface, D
...
@@ -1733,7 +1736,7 @@ static HRESULT WINAPI ID3DXBaseEffectImpl_GetBoolArray(ID3DXBaseEffect *iface, D
for
(
i
=
0
;
i
<
size
;
++
i
)
for
(
i
=
0
;
i
<
size
;
++
i
)
{
{
b
[
i
]
=
get_bool
((
DWORD
*
)
param
->
data
+
i
);
set_number
(
&
b
[
i
],
D3DXPT_BOOL
,
(
DWORD
*
)
param
->
data
+
i
,
param
->
type
);
}
}
return
D3D_OK
;
return
D3D_OK
;
}
}
...
@@ -1794,7 +1797,7 @@ static HRESULT WINAPI ID3DXBaseEffectImpl_GetInt(ID3DXBaseEffect *iface, D3DXHAN
...
@@ -1794,7 +1797,7 @@ static HRESULT WINAPI ID3DXBaseEffectImpl_GetInt(ID3DXBaseEffect *iface, D3DXHAN
{
{
if
(
param
->
columns
==
1
&&
param
->
rows
==
1
)
if
(
param
->
columns
==
1
&&
param
->
rows
==
1
)
{
{
*
n
=
get_int
(
param
->
type
,
param
->
data
);
set_number
(
n
,
D3DXPT_INT
,
param
->
data
,
param
->
type
);
TRACE
(
"Returning %i
\n
"
,
*
n
);
TRACE
(
"Returning %i
\n
"
,
*
n
);
return
D3D_OK
;
return
D3D_OK
;
}
}
...
@@ -1879,7 +1882,7 @@ static HRESULT WINAPI ID3DXBaseEffectImpl_GetIntArray(ID3DXBaseEffect *iface, D3
...
@@ -1879,7 +1882,7 @@ static HRESULT WINAPI ID3DXBaseEffectImpl_GetIntArray(ID3DXBaseEffect *iface, D3
for
(
i
=
0
;
i
<
size
;
++
i
)
for
(
i
=
0
;
i
<
size
;
++
i
)
{
{
n
[
i
]
=
get_int
(
param
->
type
,
(
DWORD
*
)
param
->
data
+
i
);
set_number
(
&
n
[
i
],
D3DXPT_INT
,
(
DWORD
*
)
param
->
data
+
i
,
param
->
type
);
}
}
return
D3D_OK
;
return
D3D_OK
;
}
}
...
@@ -1916,7 +1919,7 @@ static HRESULT WINAPI ID3DXBaseEffectImpl_GetFloat(ID3DXBaseEffect *iface, D3DXH
...
@@ -1916,7 +1919,7 @@ static HRESULT WINAPI ID3DXBaseEffectImpl_GetFloat(ID3DXBaseEffect *iface, D3DXH
if
(
f
&&
param
&&
!
param
->
element_count
&&
param
->
columns
==
1
&&
param
->
rows
==
1
)
if
(
f
&&
param
&&
!
param
->
element_count
&&
param
->
columns
==
1
&&
param
->
rows
==
1
)
{
{
*
f
=
get_float
(
param
->
type
,
(
DWORD
*
)
param
->
data
);
set_number
(
f
,
D3DXPT_FLOAT
,
(
DWORD
*
)
param
->
data
,
param
->
type
);
TRACE
(
"Returning %f
\n
"
,
*
f
);
TRACE
(
"Returning %f
\n
"
,
*
f
);
return
D3D_OK
;
return
D3D_OK
;
}
}
...
@@ -1981,7 +1984,7 @@ static HRESULT WINAPI ID3DXBaseEffectImpl_GetFloatArray(ID3DXBaseEffect *iface,
...
@@ -1981,7 +1984,7 @@ static HRESULT WINAPI ID3DXBaseEffectImpl_GetFloatArray(ID3DXBaseEffect *iface,
for
(
i
=
0
;
i
<
size
;
++
i
)
for
(
i
=
0
;
i
<
size
;
++
i
)
{
{
f
[
i
]
=
get_float
(
param
->
type
,
(
DWORD
*
)
param
->
data
+
i
);
set_number
(
&
f
[
i
],
D3DXPT_FLOAT
,
(
DWORD
*
)
param
->
data
+
i
,
param
->
type
);
}
}
return
D3D_OK
;
return
D3D_OK
;
}
}
...
...
dlls/d3dx9_36/util.c
View file @
26914eb3
...
@@ -271,12 +271,12 @@ const char *debug_d3dxparameter_registerset(D3DXREGISTER_SET r)
...
@@ -271,12 +271,12 @@ const char *debug_d3dxparameter_registerset(D3DXREGISTER_SET r)
#undef WINE_D3DX_TO_STR
#undef WINE_D3DX_TO_STR
/* parameter type conversion helpers */
/* parameter type conversion helpers */
BOOL
get_bool
(
LPCVOID
data
)
static
BOOL
get_bool
(
LPCVOID
data
)
{
{
return
(
*
(
DWORD
*
)
data
)
!=
0
;
return
(
*
(
DWORD
*
)
data
)
!=
0
;
}
}
INT
get_int
(
D3DXPARAMETER_TYPE
type
,
LPCVOID
data
)
static
INT
get_int
(
D3DXPARAMETER_TYPE
type
,
LPCVOID
data
)
{
{
INT
i
;
INT
i
;
...
@@ -303,7 +303,7 @@ INT get_int(D3DXPARAMETER_TYPE type, LPCVOID data)
...
@@ -303,7 +303,7 @@ INT get_int(D3DXPARAMETER_TYPE type, LPCVOID data)
return
i
;
return
i
;
}
}
FLOAT
get_float
(
D3DXPARAMETER_TYPE
type
,
LPCVOID
data
)
static
FLOAT
get_float
(
D3DXPARAMETER_TYPE
type
,
LPCVOID
data
)
{
{
FLOAT
f
;
FLOAT
f
;
...
...
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