summaryrefslogtreecommitdiffstats
path: root/src/math/conv.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/math/conv.h')
-rw-r--r--src/math/conv.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/math/conv.h b/src/math/conv.h
new file mode 100644
index 0000000..8b77db9
--- /dev/null
+++ b/src/math/conv.h
@@ -0,0 +1,33 @@
+/* math/conv.h
+
+ Temporary conversion functions for D3DVECTOR and FPOINT */
+
+#pragma once
+
+#define STRICT
+#define D3D_OVERLOADS
+#include <d3d.h>
+
+#include "common/struct.h"
+#include "vector.h"
+#include "point.h"
+
+inline D3DVECTOR V_TO_D3D(Math::Vector vec)
+{
+ return D3DVECTOR(vec.x, vec.y, vec.z);
+}
+
+inline Math::Vector D3D_TO_V(D3DVECTOR vec)
+{
+ return Math::Vector(vec.x, vec.y, vec.z);
+}
+
+inline FPOINT P_TO_FP(Math::Point pt)
+{
+ return FPOINT(pt.x, pt.y);
+}
+
+inline Math::Point FP_TO_P(FPOINT pt)
+{
+ return Math::Point(pt.x, pt.y);
+}