/simpletypesystem/trunk

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/simpletypesystem/trunk

« back to all changes in this revision

Viewing changes to libssts/vec.c

  • Committer: Gustav Hartvigsson
  • Date: 2021-01-07 22:46:13 UTC
  • mfrom: (131.1.1 simpletypesystem_vec_fix)
  • Revision ID: gustav.hartvigsson@gmail.com-20210107224613-4w5wj9o713ck2yp6
* Merged  lp:~gustav-hartvigsson/simpletypesystem/vec_fix

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#include "vec.h"
2
2
 
3
3
/* **************************************************************************
4
 
   **************** VEC3 (32bit int) ****************************************
 
4
   **************** Vec3_32 (32bit int) ****************************************
5
5
   ************************************************************************** */
6
6
 
7
7
#define _V_NEW_M_(TYPE) {\
20
20
  return new_v;\
21
21
}
22
22
 
23
 
Vec3 *
24
 
vec3_new (sint a,
 
23
Vec3_32 *
 
24
vec3_32_new (sint a,
25
25
          sint b,
26
26
          sint c) {
27
 
  _V_NEW_M_(Vec3);
28
 
}
29
 
 
30
 
Vec3 *
31
 
vec3_add_vec3 (Vec3 * a,
32
 
               Vec3 * b) {
33
 
  _V_ADD_M_(Vec3);
34
 
}
35
 
 
36
 
Vec3 *
37
 
vec3_add_vec3_16 (Vec3 * a,
 
27
  _V_NEW_M_(Vec3_32);
 
28
}
 
29
 
 
30
Vec3_32 *
 
31
vec3_32_add_Vec3_32 (Vec3_32 * a,
 
32
               Vec3_32 * b) {
 
33
  _V_ADD_M_(Vec3_32);
 
34
}
 
35
 
 
36
Vec3_32 *
 
37
vec3_32_add_vec3_16 (Vec3_32 * a,
38
38
                  Vec3_16 * b) {
39
 
  _V_ADD_M_(Vec3);
 
39
  _V_ADD_M_(Vec3_32);
40
40
}
41
41
 
42
 
Vec3 *
43
 
vec3_16_add_vec3 (Vec3_16 * a,
44
 
                  Vec3 * b) {
45
 
  _V_ADD_M_(Vec3);
 
42
Vec3_32 *
 
43
vec3_16_add_Vec3_32 (Vec3_16 * a,
 
44
                  Vec3_32 * b) {
 
45
  _V_ADD_M_(Vec3_32);
46
46
}
47
47
 
48
48
/* **************************************************************************
81
81
}
82
82
 
83
83
Vec3_f *
84
 
vec3_f_add_vec3 (Vec3_f * a,
85
 
                 Vec3 * b) {
 
84
vec3_f_add_Vec3_32 (Vec3_f * a,
 
85
                 Vec3_32 * b) {
86
86
  _V_ADD_M_(Vec3_f);
87
87
}
88
88
 
93
93
}
94
94
 
95
95
Vec3_f *
96
 
vec3_add_vec3_f (Vec3 * a,
 
96
vec3_add_vec3_f (Vec3_32 * a,
97
97
                Vec3_f * b) {
98
98
  _V_ADD_M_(Vec3_f);
99
99
}