You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-05 12:10:55 +00:00
Replace Array return types with TypedArray 2
This commit is contained in:
@@ -31,6 +31,7 @@
|
||||
#include "rendering_server.h"
|
||||
|
||||
#include "core/config/project_settings.h"
|
||||
#include "core/variant/typed_array.h"
|
||||
#include "servers/rendering/rendering_server_globals.h"
|
||||
#include "servers/rendering/shader_language.h"
|
||||
|
||||
@@ -1337,7 +1338,7 @@ Dictionary RenderingServer::mesh_surface_get_lods(RID p_mesh, int p_surface) con
|
||||
return ret;
|
||||
}
|
||||
|
||||
Array RenderingServer::mesh_surface_get_blend_shape_arrays(RID p_mesh, int p_surface) const {
|
||||
TypedArray<Array> RenderingServer::mesh_surface_get_blend_shape_arrays(RID p_mesh, int p_surface) const {
|
||||
SurfaceData sd = mesh_get_surface(p_mesh, p_surface);
|
||||
ERR_FAIL_COND_V(sd.vertex_count == 0, Array());
|
||||
|
||||
@@ -1359,7 +1360,7 @@ Array RenderingServer::mesh_surface_get_blend_shape_arrays(RID p_mesh, int p_sur
|
||||
|
||||
ERR_FAIL_COND_V(blend_shape_count != (uint32_t)mesh_get_blend_shape_count(p_mesh), Array());
|
||||
|
||||
Array blend_shape_array;
|
||||
TypedArray<Array> blend_shape_array;
|
||||
blend_shape_array.resize(mesh_get_blend_shape_count(p_mesh));
|
||||
for (uint32_t i = 0; i < blend_shape_count; i++) {
|
||||
Vector<uint8_t> bs_data = blend_shape_data.slice(i * divisor, (i + 1) * divisor);
|
||||
@@ -1369,7 +1370,7 @@ Array RenderingServer::mesh_surface_get_blend_shape_arrays(RID p_mesh, int p_sur
|
||||
|
||||
return blend_shape_array;
|
||||
} else {
|
||||
return Array();
|
||||
return TypedArray<Array>();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user