Fixed mesh data access errors in GLES2

1. Removed errors in mesh_surface_get_array as it's supported now
2. More accurate errors in mesh_surface_get_blend_shapes

(cherry picked from commit e19a3df98f)
This commit is contained in:
PouleyKetchoupp 2020-07-09 13:41:43 +02:00 committed by Rémi Verschelde
parent 2cf52076fd
commit 5854bf4696

View file

@ -2667,9 +2667,7 @@ PoolVector<uint8_t> RasterizerStorageGLES2::mesh_surface_get_array(RID p_mesh, i
ERR_FAIL_INDEX_V(p_surface, mesh->surfaces.size(), PoolVector<uint8_t>()); ERR_FAIL_INDEX_V(p_surface, mesh->surfaces.size(), PoolVector<uint8_t>());
Surface *surface = mesh->surfaces[p_surface]; Surface *surface = mesh->surfaces[p_surface];
#ifndef TOOLS_ENABLED
ERR_PRINT("OpenGL ES 2.0 does not allow retrieving mesh array data");
#endif
return surface->data; return surface->data;
} }
@ -2713,7 +2711,7 @@ Vector<PoolVector<uint8_t> > RasterizerStorageGLES2::mesh_surface_get_blend_shap
ERR_FAIL_COND_V(!mesh, Vector<PoolVector<uint8_t> >()); ERR_FAIL_COND_V(!mesh, Vector<PoolVector<uint8_t> >());
ERR_FAIL_INDEX_V(p_surface, mesh->surfaces.size(), Vector<PoolVector<uint8_t> >()); ERR_FAIL_INDEX_V(p_surface, mesh->surfaces.size(), Vector<PoolVector<uint8_t> >());
#ifndef TOOLS_ENABLED #ifndef TOOLS_ENABLED
ERR_PRINT("OpenGL ES 2.0 does not allow retrieving mesh array data"); ERR_PRINT("OpenGL ES 2.0 does not allow retrieving blend shape data");
#endif #endif
return mesh->surfaces[p_surface]->blend_shape_data; return mesh->surfaces[p_surface]->blend_shape_data;