Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
74750c3c
Commit
74750c3c
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 D3DXVECTOR2 structure.
parent
1efd4c02
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
131 additions
and
0 deletions
+131
-0
d3dx8math.h
include/d3dx8math.h
+26
-0
d3dx8math.inl
include/d3dx8math.inl
+105
-0
No files found.
include/d3dx8math.h
View file @
74750c3c
...
...
@@ -31,6 +31,32 @@
typedef
struct
D3DXVECTOR2
{
#ifdef __cplusplus
D3DXVECTOR2
();
D3DXVECTOR2
(
CONST
FLOAT
*
pf
);
D3DXVECTOR2
(
FLOAT
fx
,
FLOAT
fy
);
operator
FLOAT
*
();
operator
CONST
FLOAT
*
()
const
;
D3DXVECTOR2
&
operator
+=
(
CONST
D3DXVECTOR2
&
);
D3DXVECTOR2
&
operator
-=
(
CONST
D3DXVECTOR2
&
);
D3DXVECTOR2
&
operator
*=
(
FLOAT
);
D3DXVECTOR2
&
operator
/=
(
FLOAT
);
D3DXVECTOR2
operator
+
()
const
;
D3DXVECTOR2
operator
-
()
const
;
D3DXVECTOR2
operator
+
(
CONST
D3DXVECTOR2
&
)
const
;
D3DXVECTOR2
operator
-
(
CONST
D3DXVECTOR2
&
)
const
;
D3DXVECTOR2
operator
*
(
FLOAT
)
const
;
D3DXVECTOR2
operator
/
(
FLOAT
)
const
;
friend
D3DXVECTOR2
operator
*
(
FLOAT
,
CONST
D3DXVECTOR2
&
);
BOOL
operator
==
(
CONST
D3DXVECTOR2
&
)
const
;
BOOL
operator
!=
(
CONST
D3DXVECTOR2
&
)
const
;
#endif
/* __cplusplus */
FLOAT
x
,
y
;
}
D3DXVECTOR2
,
*
LPD3DXVECTOR2
;
...
...
include/d3dx8math.inl
View file @
74750c3c
...
...
@@ -21,6 +21,111 @@
/*_______________D3DXCOLOR_____________________*/
/* constructors & operators */
#ifdef __cplusplus
inline D3DXVECTOR2::D3DXVECTOR2()
{
}
inline D3DXVECTOR2::D3DXVECTOR2(CONST FLOAT *pf)
{
if(!pf) return;
x = pf[0];
y = pf[1];
}
inline D3DXVECTOR2::D3DXVECTOR2(FLOAT fx, FLOAT fy)
{
x = fx;
y = fy;
}
inline D3DXVECTOR2::operator FLOAT* ()
{
return (FLOAT*)&x;
}
inline D3DXVECTOR2::operator CONST FLOAT* () const
{
return (CONST FLOAT*)&x;
}
inline D3DXVECTOR2& D3DXVECTOR2::operator += (CONST D3DXVECTOR2& v)
{
x += v.x;
y += v.y;
return *this;
}
inline D3DXVECTOR2& D3DXVECTOR2::operator -= (CONST D3DXVECTOR2& v)
{
x -= v.x;
y -= v.y;
return *this;
}
inline D3DXVECTOR2& D3DXVECTOR2::operator *= (FLOAT f)
{
x *= f;
y *= f;
return *this;
}
inline D3DXVECTOR2& D3DXVECTOR2::operator /= (FLOAT f)
{
x /= f;
y /= f;
return *this;
}
inline D3DXVECTOR2 D3DXVECTOR2::operator + () const
{
return *this;
}
inline D3DXVECTOR2 D3DXVECTOR2::operator - () const
{
return D3DXVECTOR2(-x, -y);
}
inline D3DXVECTOR2 D3DXVECTOR2::operator + (CONST D3DXVECTOR2& v) const
{
return D3DXVECTOR2(x + v.x, y + v.y);
}
inline D3DXVECTOR2 D3DXVECTOR2::operator - (CONST D3DXVECTOR2& v) const
{
return D3DXVECTOR2(x - v.x, y - v.y);
}
inline D3DXVECTOR2 D3DXVECTOR2::operator * (FLOAT f) const
{
return D3DXVECTOR2(x * f, y * f);
}
inline D3DXVECTOR2 D3DXVECTOR2::operator / (FLOAT f) const
{
return D3DXVECTOR2(x / f, y / f);
}
inline D3DXVECTOR2 operator * (FLOAT f, CONST D3DXVECTOR2& v)
{
return D3DXVECTOR2(f * v.x, f * v.y);
}
inline BOOL D3DXVECTOR2::operator == (CONST D3DXVECTOR2& v) const
{
return x == v.x && y == v.y;
}
inline BOOL D3DXVECTOR2::operator != (CONST D3DXVECTOR2& v) const
{
return x != v.x || y != v.y;
}
#endif /* __cplusplus */
static inline D3DXCOLOR* D3DXColorAdd(D3DXCOLOR *pout, CONST D3DXCOLOR *pc1, CONST D3DXCOLOR *pc2)
{
if ( !pout || !pc1 || !pc2 ) return NULL;
...
...
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