summaryrefslogtreecommitdiffstats
path: root/core/vector.h
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2020-05-01 09:34:23 -0300
committerJuan Linietsky <reduzio@gmail.com>2020-05-10 15:59:09 -0300
commit1bea8e1eacc68bcedbd3f207395bccf11011dae2 (patch)
treeb75303a69491978c1e13360a3e6f355c5234dfe0 /core/vector.h
parent6a0473bcc23c096ef9ee929632a209761c2668f6 (diff)
downloadredot-engine-1bea8e1eacc68bcedbd3f207395bccf11011dae2.tar.gz
New lightmapper
-Added LocalVector (needed it) -Added stb_rect_pack (It's pretty cool, we could probably use it for other stuff too) -Fixes and changes all around the place -Added library for 128 bits fixed point (required for Delaunay3D)
Diffstat (limited to 'core/vector.h')
-rw-r--r--core/vector.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/core/vector.h b/core/vector.h
index b2133f800b..74e0ab91c0 100644
--- a/core/vector.h
+++ b/core/vector.h
@@ -39,6 +39,7 @@
#include "core/cowdata.h"
#include "core/error_macros.h"
+#include "core/os/copymem.h"
#include "core/os/memory.h"
#include "core/sort_array.h"
@@ -125,6 +126,13 @@ public:
return *this;
}
+ Vector<uint8_t> to_byte_array() const {
+ Vector<uint8_t> ret;
+ ret.resize(size() * sizeof(T));
+ copymem(ret.ptrw(), ptr(), sizeof(T) * size());
+ return ret;
+ }
+
Vector<T> subarray(int p_from, int p_to) const {
if (p_from < 0) {