summaryrefslogtreecommitdiffstats
path: root/core/vector.h
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2020-05-11 13:45:48 +0200
committerGitHub <noreply@github.com>2020-05-11 13:45:48 +0200
commit32133a11b56761df99579ad96ee29a47d2aed6b4 (patch)
treeab68992cfe6b1f59a618f713545fdcb3b6488b07 /core/vector.h
parentbbdfc7353c3af72fcdf037ff10b8571aa2afc230 (diff)
parent1bea8e1eacc68bcedbd3f207395bccf11011dae2 (diff)
downloadredot-engine-32133a11b56761df99579ad96ee29a47d2aed6b4.tar.gz
Merge pull request #38386 from reduz/new-lightmapper
New GPU lightmapper
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) {