Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source/blender/blenlib/BLI_math_vector.h1
-rw-r--r--source/blender/blenlib/intern/math_vector.c9
-rw-r--r--source/blender/editors/util/numinput.c15
3 files changed, 19 insertions, 6 deletions
diff --git a/source/blender/blenlib/BLI_math_vector.h b/source/blender/blenlib/BLI_math_vector.h
index ddf716e67f8..f816ad53d15 100644
--- a/source/blender/blenlib/BLI_math_vector.h
+++ b/source/blender/blenlib/BLI_math_vector.h
@@ -313,6 +313,7 @@ void msub_vn_vn(float *array_tar, const float *array_src, const float f, const i
void msub_vn_vnvn(float *array_tar, const float *array_src_a, const float *array_src_b, const float f, const int size);
void interp_vn_vn(float *array_tar, const float *array_src, const float t, const int size);
void fill_vn_i(int *array_tar, const int size, const int val);
+void fill_vn_short(short *array_tar, const int size, const short val);
void fill_vn_ushort(unsigned short *array_tar, const int size, const unsigned short val);
void fill_vn_fl(float *array_tar, const int size, const float val);
diff --git a/source/blender/blenlib/intern/math_vector.c b/source/blender/blenlib/intern/math_vector.c
index cfe33dd534a..7d3829f04d3 100644
--- a/source/blender/blenlib/intern/math_vector.c
+++ b/source/blender/blenlib/intern/math_vector.c
@@ -992,6 +992,15 @@ void fill_vn_i(int *array_tar, const int size, const int val)
}
}
+void fill_vn_short(short *array_tar, const int size, const short val)
+{
+ short *tar = array_tar + (size - 1);
+ int i = size;
+ while (i--) {
+ *(tar--) = val;
+ }
+}
+
void fill_vn_ushort(unsigned short *array_tar, const int size, const unsigned short val)
{
unsigned short *tar = array_tar + (size - 1);
diff --git a/source/blender/editors/util/numinput.c b/source/blender/editors/util/numinput.c
index 850f1d1c5cc..ee391af185d 100644
--- a/source/blender/editors/util/numinput.c
+++ b/source/blender/editors/util/numinput.c
@@ -70,17 +70,20 @@ enum {
void initNumInput(NumInput *n)
{
- n->unit_sys = USER_UNIT_NONE;
- n->unit_type[0] = n->unit_type[1] = n->unit_type[2] = B_UNIT_NONE;
- n->idx = 0;
n->idx_max = 0;
+ n->unit_sys = USER_UNIT_NONE;
+ fill_vn_i(n->unit_type, NUM_MAX_ELEMENTS, B_UNIT_NONE);
+ n->unit_use_radians = false;
+
n->flag = 0;
- n->val_flag[0] = n->val_flag[1] = n->val_flag[2] = 0;
- zero_v3(n->val_org);
+ fill_vn_short(n->val_flag, NUM_MAX_ELEMENTS, 0);
zero_v3(n->val);
+ fill_vn_fl(n->val_org, NUM_MAX_ELEMENTS, 0.0f);
+ fill_vn_fl(n->val_inc, NUM_MAX_ELEMENTS, 1.0f);
+
+ n->idx = 0;
n->str[0] = '\0';
n->str_cur = 0;
- copy_v3_fl(n->val_inc, 1.0f);
}
/* str must be NUM_STR_REP_LEN * (idx_max + 1) length. */