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
dca53f18
Commit
dca53f18
authored
Nov 09, 2007
by
Tony Wasserka
Committed by
Alexandre Julliard
Nov 12, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dx8: Implement the C++ stuff of the D3DXVECTOR4 structure.
parent
d3204607
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
138 additions
and
0 deletions
+138
-0
d3dx8math.h
include/d3dx8math.h
+26
-0
d3dx8math.inl
include/d3dx8math.inl
+112
-0
No files found.
include/d3dx8math.h
View file @
dca53f18
...
...
@@ -96,6 +96,32 @@ typedef struct _D3DVECTOR D3DXVECTOR3, *LPD3DXVECTOR3;
typedef
struct
D3DXVECTOR4
{
#ifdef __cplusplus
D3DXVECTOR4
();
D3DXVECTOR4
(
CONST
FLOAT
*
pf
);
D3DXVECTOR4
(
FLOAT
fx
,
FLOAT
fy
,
FLOAT
fz
,
FLOAT
fw
);
operator
FLOAT
*
();
operator
CONST
FLOAT
*
()
const
;
D3DXVECTOR4
&
operator
+=
(
CONST
D3DXVECTOR4
&
);
D3DXVECTOR4
&
operator
-=
(
CONST
D3DXVECTOR4
&
);
D3DXVECTOR4
&
operator
*=
(
FLOAT
);
D3DXVECTOR4
&
operator
/=
(
FLOAT
);
D3DXVECTOR4
operator
+
()
const
;
D3DXVECTOR4
operator
-
()
const
;
D3DXVECTOR4
operator
+
(
CONST
D3DXVECTOR4
&
)
const
;
D3DXVECTOR4
operator
-
(
CONST
D3DXVECTOR4
&
)
const
;
D3DXVECTOR4
operator
*
(
FLOAT
)
const
;
D3DXVECTOR4
operator
/
(
FLOAT
)
const
;
friend
D3DXVECTOR4
operator
*
(
FLOAT
,
CONST
D3DXVECTOR4
&
);
BOOL
operator
==
(
CONST
D3DXVECTOR4
&
)
const
;
BOOL
operator
!=
(
CONST
D3DXVECTOR4
&
)
const
;
#endif
/* __cplusplus */
FLOAT
x
,
y
,
z
,
w
;
}
D3DXVECTOR4
,
*
LPD3DXVECTOR4
;
...
...
include/d3dx8math.inl
View file @
dca53f18
...
...
@@ -236,6 +236,118 @@ inline BOOL D3DXVECTOR3::operator != (CONST D3DXVECTOR3& v) const
return x != v.x || y != v.y || z != v.z;
}
inline D3DXVECTOR4::D3DXVECTOR4()
{
}
inline D3DXVECTOR4::D3DXVECTOR4(CONST FLOAT *pf)
{
if(!pf) return;
x = pf[0];
y = pf[1];
z = pf[2];
w = pf[3];
}
inline D3DXVECTOR4::D3DXVECTOR4(FLOAT fx, FLOAT fy, FLOAT fz, FLOAT fw)
{
x = fx;
y = fy;
z = fz;
w = fw;
}
inline D3DXVECTOR4::operator FLOAT* ()
{
return (FLOAT*)&x;
}
inline D3DXVECTOR4::operator CONST FLOAT* () const
{
return (CONST FLOAT*)&x;
}
inline D3DXVECTOR4& D3DXVECTOR4::operator += (CONST D3DXVECTOR4& v)
{
x += v.x;
y += v.y;
z += v.z;
w += v.w;
return *this;
}
inline D3DXVECTOR4& D3DXVECTOR4::operator -= (CONST D3DXVECTOR4& v)
{
x -= v.x;
y -= v.y;
z -= v.z;
w -= v.w;
return *this;
}
inline D3DXVECTOR4& D3DXVECTOR4::operator *= (FLOAT f)
{
x *= f;
y *= f;
z *= f;
w *= f;
return *this;
}
inline D3DXVECTOR4& D3DXVECTOR4::operator /= (FLOAT f)
{
x /= f;
y /= f;
z /= f;
w /= f;
return *this;
}
inline D3DXVECTOR4 D3DXVECTOR4::operator + () const
{
return *this;
}
inline D3DXVECTOR4 D3DXVECTOR4::operator - () const
{
return D3DXVECTOR4(-x, -y, -z, -w);
}
inline D3DXVECTOR4 D3DXVECTOR4::operator + (CONST D3DXVECTOR4& v) const
{
return D3DXVECTOR4(x + v.x, y + v.y, z + v.z, w + v.w);
}
inline D3DXVECTOR4 D3DXVECTOR4::operator - (CONST D3DXVECTOR4& v) const
{
return D3DXVECTOR4(x - v.x, y - v.y, z - v.z, w - v.w);
}
inline D3DXVECTOR4 D3DXVECTOR4::operator * (FLOAT f) const
{
return D3DXVECTOR4(x * f, y * f, z * f, w * f);
}
inline D3DXVECTOR4 D3DXVECTOR4::operator / (FLOAT f) const
{
return D3DXVECTOR4(x / f, y / f, z / f, w / f);
}
inline D3DXVECTOR4 operator * (FLOAT f, CONST D3DXVECTOR4& v)
{
return D3DXVECTOR4(f * v.x, f * v.y, f * v.z, f * v.w);
}
inline BOOL D3DXVECTOR4::operator == (CONST D3DXVECTOR4& v) const
{
return x == v.x && y == v.y && z == v.z && w == v.w;
}
inline BOOL D3DXVECTOR4::operator != (CONST D3DXVECTOR4& v) const
{
return x != v.x || y != v.y || z != v.z || w != v.w;
}
#endif /* __cplusplus */
/*_______________D3DXCOLOR_____________________*/
...
...
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