@@ -9,27 +9,22 @@ object vector {
9
9
type struct_point = native.CStruct2 [native.CFloat , native.CFloat ]
10
10
type struct_vector = native.CStruct2 [struct_point, struct_point]
11
11
def add (v1 : native.Ptr [struct_vector], v2 : native.Ptr [struct_vector]): native.Ptr [struct_vector] = native.extern
12
- }
13
-
14
- import vector ._
15
12
16
- object vectorHelpers {
17
-
18
- implicit class struct_point_ops (val p : native.Ptr [struct_point]) extends AnyVal {
19
- def x : native.CFloat = ! p._1
20
- def x_= (value : native.CFloat ): Unit = ! p._1 = value
21
- def y : native.CFloat = ! p._2
22
- def y_= (value : native.CFloat ): Unit = ! p._2 = value
13
+ object implicits {
14
+ implicit class struct_point_ops (val p : native.Ptr [struct_point]) extends AnyVal {
15
+ def x : native.CFloat = ! p._1
16
+ def x_= (value : native.CFloat ): Unit = ! p._1 = value
17
+ def y : native.CFloat = ! p._2
18
+ def y_= (value : native.CFloat ): Unit = ! p._2 = value
19
+ }
20
+ def struct_point ()(implicit z : native.Zone ): native.Ptr [struct_point] = native.alloc[struct_point]
21
+
22
+ implicit class struct_vector_ops (val p : native.Ptr [struct_vector]) extends AnyVal {
23
+ def a : native.Ptr [struct_point] = p._1
24
+ def a_= (value : native.Ptr [struct_point]): Unit = ! p._1 = ! value
25
+ def b : native.Ptr [struct_point] = p._2
26
+ def b_= (value : native.Ptr [struct_point]): Unit = ! p._2 = ! value
27
+ }
28
+ def struct_vector ()(implicit z : native.Zone ): native.Ptr [struct_vector] = native.alloc[struct_vector]
23
29
}
24
-
25
- def struct_point ()(implicit z : native.Zone ): native.Ptr [struct_point] = native.alloc[struct_point]
26
-
27
- implicit class struct_vector_ops (val p : native.Ptr [struct_vector]) extends AnyVal {
28
- def a : native.Ptr [struct_point] = p._1
29
- def a_= (value : native.Ptr [struct_point]): Unit = ! p._1 = ! value
30
- def b : native.Ptr [struct_point] = p._2
31
- def b_= (value : native.Ptr [struct_point]): Unit = ! p._2 = ! value
32
- }
33
-
34
- def struct_vector ()(implicit z : native.Zone ): native.Ptr [struct_vector] = native.alloc[struct_vector]
35
30
}
0 commit comments