[Bf-blender-cvs] [26e9c2147e2] master: Blenloader: Add utility function to write double array

Hans Goudey noreply at git.blender.org
Tue Dec 15 19:43:28 CET 2020


Commit: 26e9c2147e2810d5238408b029195d427a78f80e
Author: Hans Goudey
Date:   Tue Dec 15 12:43:21 2020 -0600
Branches: master
https://developer.blender.org/rB26e9c2147e2810d5238408b029195d427a78f80e

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.

===================================================================

M	source/blender/blenloader/BLO_read_write.h
M	source/blender/blenloader/intern/writefile.c

===================================================================

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);



More information about the Bf-blender-cvs mailing list