fixed multimesh_instance_get_color

This commit is contained in:
Niko Abeler 2017-08-12 16:17:53 +02:00
parent 23f6d3fa69
commit 5d2b059d46

View File

@ -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()); ERR_FAIL_COND_V(multimesh->color_format == VS::MULTIMESH_COLOR_NONE, Color());
int stride = multimesh->color_floats + multimesh->xform_floats; 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) { if (multimesh->color_format == VS::MULTIMESH_COLOR_8BIT) {
union { union {
@ -3965,6 +3965,8 @@ Color RasterizerStorageGLES3::multimesh_instance_get_color(RID p_multimesh, int
float colf; float colf;
} cu; } cu;
cu.colf = dataptr[0];
return Color::hex(BSWAP32(cu.colu)); return Color::hex(BSWAP32(cu.colu));
} else if (multimesh->color_format == VS::MULTIMESH_COLOR_FLOAT) { } else if (multimesh->color_format == VS::MULTIMESH_COLOR_FLOAT) {