Commit 94ccd3f0 authored by Tony Wasserka's avatar Tony Wasserka Committed by Alexandre Julliard

d3dx8: Implement the C++ stuff of the D3DXPLANE structure.

parent 00bcbe25
...@@ -201,6 +201,20 @@ typedef struct D3DXQUATERNION ...@@ -201,6 +201,20 @@ typedef struct D3DXQUATERNION
typedef struct D3DXPLANE typedef struct D3DXPLANE
{ {
#ifdef __cplusplus
D3DXPLANE();
D3DXPLANE(CONST FLOAT *pf);
D3DXPLANE(FLOAT fa, FLOAT fb, FLOAT fc, FLOAT fd);
operator FLOAT* ();
operator CONST FLOAT* () const;
D3DXPLANE operator + () const;
D3DXPLANE operator - () const;
BOOL operator == (CONST D3DXPLANE&) const;
BOOL operator != (CONST D3DXPLANE&) const;
#endif /* __cplusplus */
FLOAT a, b, c, d; FLOAT a, b, c, d;
} D3DXPLANE, *LPD3DXPLANE; } D3DXPLANE, *LPD3DXPLANE;
......
...@@ -639,6 +639,57 @@ inline BOOL D3DXQUATERNION::operator != (CONST D3DXQUATERNION& quat) const ...@@ -639,6 +639,57 @@ inline BOOL D3DXQUATERNION::operator != (CONST D3DXQUATERNION& quat) const
return x != quat.x || y != quat.y || z != quat.z || w != quat.w; return x != quat.x || y != quat.y || z != quat.z || w != quat.w;
} }
inline D3DXPLANE::D3DXPLANE()
{
}
inline D3DXPLANE::D3DXPLANE(CONST FLOAT *pf)
{
if(!pf) return;
a = pf[0];
b = pf[1];
c = pf[2];
d = pf[3];
}
inline D3DXPLANE::D3DXPLANE(FLOAT fa, FLOAT fb, FLOAT fc, FLOAT fd)
{
a = fa;
b = fb;
c = fc;
d = fd;
}
inline D3DXPLANE::operator FLOAT* ()
{
return (FLOAT*)&a;
}
inline D3DXPLANE::operator CONST FLOAT* () const
{
return (CONST FLOAT*)&a;
}
inline D3DXPLANE D3DXPLANE::operator + () const
{
return *this;
}
inline D3DXPLANE D3DXPLANE::operator - () const
{
return D3DXPLANE(-a, -b, -c, -d);
}
inline BOOL D3DXPLANE::operator == (CONST D3DXPLANE& pl) const
{
return a == pl.a && b == pl.b && c == pl.c && d == pl.d;
}
inline BOOL D3DXPLANE::operator != (CONST D3DXPLANE& pl) const
{
return a != pl.a || b != pl.b || c != pl.c || d != pl.d;
}
#endif /* __cplusplus */ #endif /* __cplusplus */
/*_______________D3DXCOLOR_____________________*/ /*_______________D3DXCOLOR_____________________*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment