summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiko Abeler <me@h4kor.de>2017-08-12 16:17:53 +0200
committerNiko Abeler <me@h4kor.de>2017-08-12 16:17:53 +0200
commit5d2b059d461edb641a8224b32accd7e58cf8ded3 (patch)
treeb6ee66c1f86ee9d116e6166b9b54ddf11e154e70
parent23f6d3fa69935c90c6cdcee342ae99d226e9b4ab (diff)
fixed multimesh_instance_get_color
-rw-r--r--drivers/gles3/rasterizer_storage_gles3.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/gles3/rasterizer_storage_gles3.cpp b/drivers/gles3/rasterizer_storage_gles3.cpp
index a8e4bc0d4b..8e7f9b2a70 100644
--- a/drivers/gles3/rasterizer_storage_gles3.cpp
+++ b/drivers/gles3/rasterizer_storage_gles3.cpp
@@ -3957,7 +3957,7 @@ Color RasterizerStorageGLES3::multimesh_instance_get_color(RID p_multimesh, int
ERR_FAIL_COND_V(multimesh->color_format == VS::MULTIMESH_COLOR_NONE, Color());
int stride = multimesh->color_floats + multimesh->xform_floats;
- float *dataptr = &multimesh->data[stride * p_index + multimesh->color_floats];
+ float *dataptr = &multimesh->data[stride * p_index + multimesh->xform_floats];
if (multimesh->color_format == VS::MULTIMESH_COLOR_8BIT) {
union {
@@ -3965,6 +3965,8 @@ Color RasterizerStorageGLES3::multimesh_instance_get_color(RID p_multimesh, int
float colf;
} cu;
+ cu.colf = dataptr[0];
+
return Color::hex(BSWAP32(cu.colu));
} else if (multimesh->color_format == VS::MULTIMESH_COLOR_FLOAT) {