Commit 9dcd0f5f authored by Alexandre Julliard's avatar Alexandre Julliard

d3dx8: The inline functions should be static instead of extern.

parent 8d8a5f06
...@@ -58,15 +58,6 @@ typedef struct D3DXCOLOR ...@@ -58,15 +58,6 @@ typedef struct D3DXCOLOR
FLOAT r, g, b, a; FLOAT r, g, b, a;
} D3DXCOLOR, *LPD3DXCOLOR; } D3DXCOLOR, *LPD3DXCOLOR;
D3DXVECTOR2* D3DXVec2Add(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2); #include <d3dx8math.inl>
FLOAT D3DXVec2CCW(CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2);
FLOAT D3DXVec2Dot(CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2);
FLOAT D3DXVec2Length(CONST D3DXVECTOR2 *pv);
FLOAT D3DXVec2LengthSq(CONST D3DXVECTOR2 *pv);
D3DXVECTOR2* D3DXVec2Lerp(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2, FLOAT s);
D3DXVECTOR2* D3DXVec2Maximize(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2);
D3DXVECTOR2* D3DXVec2Minimize(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2);
D3DXVECTOR2* D3DXVec2Scale(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv, FLOAT s);
D3DXVECTOR2* D3DXVec2Subtract(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2);
#endif /* __D3DX8MATH_H__ */ #endif /* __D3DX8MATH_H__ */
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
#ifndef __D3DX8MATH_INL__ #ifndef __D3DX8MATH_INL__
#define __D3DX8MATH_INL__ #define __D3DX8MATH_INL__
extern inline D3DXVECTOR2* D3DXVec2Add(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2) static inline D3DXVECTOR2* D3DXVec2Add(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2)
{ {
if ( !pout || !pv1 || !pv2) return NULL; if ( !pout || !pv1 || !pv2) return NULL;
pout->x = pv1->x + pv2->x; pout->x = pv1->x + pv2->x;
...@@ -27,31 +27,31 @@ extern inline D3DXVECTOR2* D3DXVec2Add(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv1 ...@@ -27,31 +27,31 @@ extern inline D3DXVECTOR2* D3DXVec2Add(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv1
return pout; return pout;
} }
extern inline FLOAT D3DXVec2CCW(CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2) static inline FLOAT D3DXVec2CCW(CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2)
{ {
if ( !pv1 || !pv2) return 0.0f; if ( !pv1 || !pv2) return 0.0f;
return ( (pv1->x) * (pv2->y) - (pv1->y) * (pv2->x) ); return ( (pv1->x) * (pv2->y) - (pv1->y) * (pv2->x) );
} }
extern inline FLOAT D3DXVec2Dot(CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2) static inline FLOAT D3DXVec2Dot(CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2)
{ {
if ( !pv1 || !pv2) return 0.0f; if ( !pv1 || !pv2) return 0.0f;
return ( (pv1->x * pv2->x + pv1->y * pv2->y) ); return ( (pv1->x * pv2->x + pv1->y * pv2->y) );
} }
extern inline FLOAT D3DXVec2Length(CONST D3DXVECTOR2 *pv) static inline FLOAT D3DXVec2Length(CONST D3DXVECTOR2 *pv)
{ {
if (!pv) return 0.0f; if (!pv) return 0.0f;
return sqrt( (pv->x) * (pv->x) + (pv->y) * (pv->y) ); return sqrt( (pv->x) * (pv->x) + (pv->y) * (pv->y) );
} }
extern inline FLOAT D3DXVec2LengthSq(CONST D3DXVECTOR2 *pv) static inline FLOAT D3DXVec2LengthSq(CONST D3DXVECTOR2 *pv)
{ {
if (!pv) return 0.0f; if (!pv) return 0.0f;
return( (pv->x) * (pv->x) + (pv->y) * (pv->y) ); return( (pv->x) * (pv->x) + (pv->y) * (pv->y) );
} }
extern inline D3DXVECTOR2* D3DXVec2Lerp(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2, FLOAT s) static inline D3DXVECTOR2* D3DXVec2Lerp(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2, FLOAT s)
{ {
if ( !pout || !pv1 || !pv2) return NULL; if ( !pout || !pv1 || !pv2) return NULL;
pout->x = (1-s) * (pv1->x) + s * (pv2->x); pout->x = (1-s) * (pv1->x) + s * (pv2->x);
...@@ -59,7 +59,7 @@ extern inline D3DXVECTOR2* D3DXVec2Lerp(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv ...@@ -59,7 +59,7 @@ extern inline D3DXVECTOR2* D3DXVec2Lerp(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv
return pout; return pout;
} }
extern inline D3DXVECTOR2* D3DXVec2Maximize(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2) static inline D3DXVECTOR2* D3DXVec2Maximize(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2)
{ {
if ( !pout || !pv1 || !pv2) return NULL; if ( !pout || !pv1 || !pv2) return NULL;
pout->x = max(pv1->x , pv2->x); pout->x = max(pv1->x , pv2->x);
...@@ -67,7 +67,7 @@ extern inline D3DXVECTOR2* D3DXVec2Maximize(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 ...@@ -67,7 +67,7 @@ extern inline D3DXVECTOR2* D3DXVec2Maximize(D3DXVECTOR2 *pout, CONST D3DXVECTOR2
return pout; return pout;
} }
extern inline D3DXVECTOR2* D3DXVec2Minimize(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2) static inline D3DXVECTOR2* D3DXVec2Minimize(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2)
{ {
if ( !pout || !pv1 || !pv2) return NULL; if ( !pout || !pv1 || !pv2) return NULL;
pout->x = min(pv1->x , pv2->x); pout->x = min(pv1->x , pv2->x);
...@@ -75,7 +75,7 @@ extern inline D3DXVECTOR2* D3DXVec2Minimize(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 ...@@ -75,7 +75,7 @@ extern inline D3DXVECTOR2* D3DXVec2Minimize(D3DXVECTOR2 *pout, CONST D3DXVECTOR2
return pout; return pout;
} }
extern inline D3DXVECTOR2* D3DXVec2Scale(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv, FLOAT s) static inline D3DXVECTOR2* D3DXVec2Scale(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv, FLOAT s)
{ {
if ( !pout || !pv) return NULL; if ( !pout || !pv) return NULL;
pout->x = s * (pv->x); pout->x = s * (pv->x);
...@@ -83,7 +83,7 @@ extern inline D3DXVECTOR2* D3DXVec2Scale(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *p ...@@ -83,7 +83,7 @@ extern inline D3DXVECTOR2* D3DXVec2Scale(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *p
return pout; return pout;
} }
extern inline D3DXVECTOR2* D3DXVec2Subtract(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2) static inline D3DXVECTOR2* D3DXVec2Subtract(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2)
{ {
if ( !pout || !pv1 || !pv2) return NULL; if ( !pout || !pv1 || !pv2) return NULL;
pout->x = pv1->x - pv2->x; pout->x = pv1->x - pv2->x;
......
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