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
65c651e3
Commit
65c651e3
authored
Sep 05, 2012
by
Rico Schüller
Committed by
Alexandre Julliard
Sep 06, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dx9: Move D3DXPARAMETER_TYPE conversion helpers to util.
parent
b5c663ee
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
91 additions
and
84 deletions
+91
-84
d3dx9_36_private.h
dlls/d3dx9_36/d3dx9_36_private.h
+6
-0
effect.c
dlls/d3dx9_36/effect.c
+0
-84
util.c
dlls/d3dx9_36/util.c
+85
-0
No files found.
dlls/d3dx9_36/d3dx9_36_private.h
View file @
65c651e3
...
...
@@ -93,4 +93,10 @@ const char *debug_d3dxparameter_class(D3DXPARAMETER_CLASS c) DECLSPEC_HIDDEN;
const
char
*
debug_d3dxparameter_type
(
D3DXPARAMETER_TYPE
t
)
DECLSPEC_HIDDEN
;
const
char
*
debug_d3dxparameter_registerset
(
D3DXREGISTER_SET
r
)
DECLSPEC_HIDDEN
;
/* 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
;
#endif
/* __WINE_D3DX9_36_PRIVATE_H */
dlls/d3dx9_36/effect.c
View file @
65c651e3
...
...
@@ -847,90 +847,6 @@ static void free_effect_compiler(struct ID3DXEffectCompilerImpl *compiler)
}
}
static
INT
get_int
(
D3DXPARAMETER_TYPE
type
,
LPCVOID
data
)
{
INT
i
;
switch
(
type
)
{
case
D3DXPT_FLOAT
:
i
=
*
(
FLOAT
*
)
data
;
break
;
case
D3DXPT_INT
:
i
=
*
(
INT
*
)
data
;
break
;
case
D3DXPT_BOOL
:
i
=
*
(
BOOL
*
)
data
;
break
;
default:
i
=
0
;
FIXME
(
"Unhandled type %s. This should not happen!
\n
"
,
debug_d3dxparameter_type
(
type
));
break
;
}
return
i
;
}
inline
static
FLOAT
get_float
(
D3DXPARAMETER_TYPE
type
,
LPCVOID
data
)
{
FLOAT
f
;
switch
(
type
)
{
case
D3DXPT_FLOAT
:
f
=
*
(
FLOAT
*
)
data
;
break
;
case
D3DXPT_INT
:
f
=
*
(
INT
*
)
data
;
break
;
case
D3DXPT_BOOL
:
f
=
*
(
BOOL
*
)
data
;
break
;
default:
f
=
0
.
0
f
;
FIXME
(
"Unhandled type %s. This should not happen!
\n
"
,
debug_d3dxparameter_type
(
type
));
break
;
}
return
f
;
}
static
inline
BOOL
get_bool
(
LPCVOID
data
)
{
return
(
*
(
DWORD
*
)
data
)
!=
0
;
}
static
void
set_number
(
LPVOID
outdata
,
D3DXPARAMETER_TYPE
outtype
,
LPCVOID
indata
,
D3DXPARAMETER_TYPE
intype
)
{
TRACE
(
"Changing from type %s to type %s
\n
"
,
debug_d3dxparameter_type
(
intype
),
debug_d3dxparameter_type
(
outtype
));
switch
(
outtype
)
{
case
D3DXPT_FLOAT
:
*
(
FLOAT
*
)
outdata
=
get_float
(
intype
,
indata
);
break
;
case
D3DXPT_BOOL
:
*
(
BOOL
*
)
outdata
=
get_bool
(
indata
);
break
;
case
D3DXPT_INT
:
*
(
INT
*
)
outdata
=
get_int
(
intype
,
indata
);
break
;
default:
FIXME
(
"Unhandled type %s. This should not happen!
\n
"
,
debug_d3dxparameter_type
(
outtype
));
*
(
INT
*
)
outdata
=
0
;
break
;
}
}
static
void
get_vector
(
struct
d3dx_parameter
*
param
,
D3DXVECTOR4
*
vector
)
{
UINT
i
;
...
...
dlls/d3dx9_36/util.c
View file @
65c651e3
...
...
@@ -269,3 +269,88 @@ const char *debug_d3dxparameter_registerset(D3DXREGISTER_SET r)
}
#undef WINE_D3DX_TO_STR
/* parameter type conversion helpers */
INT
get_int
(
D3DXPARAMETER_TYPE
type
,
LPCVOID
data
)
{
INT
i
;
switch
(
type
)
{
case
D3DXPT_FLOAT
:
i
=
*
(
FLOAT
*
)
data
;
break
;
case
D3DXPT_INT
:
i
=
*
(
INT
*
)
data
;
break
;
case
D3DXPT_BOOL
:
i
=
*
(
BOOL
*
)
data
;
break
;
default:
i
=
0
;
FIXME
(
"Unhandled type %s. This should not happen!
\n
"
,
debug_d3dxparameter_type
(
type
));
break
;
}
return
i
;
}
FLOAT
get_float
(
D3DXPARAMETER_TYPE
type
,
LPCVOID
data
)
{
FLOAT
f
;
switch
(
type
)
{
case
D3DXPT_FLOAT
:
f
=
*
(
FLOAT
*
)
data
;
break
;
case
D3DXPT_INT
:
f
=
*
(
INT
*
)
data
;
break
;
case
D3DXPT_BOOL
:
f
=
*
(
BOOL
*
)
data
;
break
;
default:
f
=
0
.
0
f
;
FIXME
(
"Unhandled type %s. This should not happen!
\n
"
,
debug_d3dxparameter_type
(
type
));
break
;
}
return
f
;
}
BOOL
get_bool
(
LPCVOID
data
)
{
return
(
*
(
DWORD
*
)
data
)
!=
0
;
}
void
set_number
(
LPVOID
outdata
,
D3DXPARAMETER_TYPE
outtype
,
LPCVOID
indata
,
D3DXPARAMETER_TYPE
intype
)
{
TRACE
(
"Changing from type %s to type %s
\n
"
,
debug_d3dxparameter_type
(
intype
),
debug_d3dxparameter_type
(
outtype
));
switch
(
outtype
)
{
case
D3DXPT_FLOAT
:
*
(
FLOAT
*
)
outdata
=
get_float
(
intype
,
indata
);
break
;
case
D3DXPT_BOOL
:
*
(
BOOL
*
)
outdata
=
get_bool
(
indata
);
break
;
case
D3DXPT_INT
:
*
(
INT
*
)
outdata
=
get_int
(
intype
,
indata
);
break
;
default:
FIXME
(
"Unhandled type %s. This should not happen!
\n
"
,
debug_d3dxparameter_type
(
outtype
));
*
(
INT
*
)
outdata
=
0
;
break
;
}
}
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