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:
authorHans Goudey <h.goudey@me.com>2020-12-15 21:43:21 +0300
committerHans Goudey <h.goudey@me.com>2020-12-15 21:43:21 +0300
commit26e9c2147e2810d5238408b029195d427a78f80e (patch)
tree50921a655e2a7d637c1698d1464b18ee1b438c45
parentd59e87acf0b8954390ce2691145613ea8585010f (diff)
Blenloader: Add utility function to write double array
It makes sense to support writing double arrays just like floats. This is just split from a patch (D9697) to slim it down some.
-rw-r--r--source/blender/blenloader/BLO_read_write.h1
-rw-r--r--source/blender/blenloader/intern/writefile.c5
2 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/blenloader/BLO_read_write.h b/source/blender/blenloader/BLO_read_write.h
index c4480e2c544..ea0532d884b 100644
--- a/source/blender/blenloader/BLO_read_write.h
+++ b/source/blender/blenloader/BLO_read_write.h
@@ -160,6 +160,7 @@ void BLO_write_raw(BlendWriter *writer, size_t size_in_bytes, const void *data_p
void BLO_write_int32_array(BlendWriter *writer, uint num, const int32_t *data_ptr);
void BLO_write_uint32_array(BlendWriter *writer, uint num, const uint32_t *data_ptr);
void BLO_write_float_array(BlendWriter *writer, uint num, const float *data_ptr);
+void BLO_write_double_array(BlendWriter *writer, uint num, const double *data_ptr);
void BLO_write_float3_array(BlendWriter *writer, uint num, const float *data_ptr);
void BLO_write_pointer_array(BlendWriter *writer, uint num, const void *data_ptr);
void BLO_write_string(BlendWriter *writer, const char *data_ptr);
diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c
index e7d55538f7e..0a4f2fde93f 100644
--- a/source/blender/blenloader/intern/writefile.c
+++ b/source/blender/blenloader/intern/writefile.c
@@ -1374,6 +1374,11 @@ void BLO_write_float_array(BlendWriter *writer, uint num, const float *data_ptr)
BLO_write_raw(writer, sizeof(float) * (size_t)num, data_ptr);
}
+void BLO_write_double_array(BlendWriter *writer, uint num, const double *data_ptr)
+{
+ BLO_write_raw(writer, sizeof(double) * (size_t)num, data_ptr);
+}
+
void BLO_write_pointer_array(BlendWriter *writer, uint num, const void *data_ptr)
{
BLO_write_raw(writer, sizeof(void *) * (size_t)num, data_ptr);