Merge pull request #10305 from H4kor/gles3
Fixes a bug in multimesh_instance_get_color
This commit is contained in:
commit
51066fcde7
1 changed files with 3 additions and 1 deletions
|
@ -3963,7 +3963,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 {
|
||||
|
@ -3971,6 +3971,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) {
|
||||
|
|
Loading…
Reference in a new issue