mirror of
https://github.com/godotengine/godot.git
synced 2025-12-08 06:09:55 +00:00
Add resize_initialized and resize_uninitialized to Vector. These functions serve as replacements for resize, to make sure the caller understands whether elements need to be initialized 'by hand' after the call.
This commit is contained in:
parent
6c9765d87e
commit
4cb8a0c77e
24 changed files with 62 additions and 44 deletions
|
|
@ -645,7 +645,7 @@ Array SurfaceTool::commit_to_arrays() {
|
|||
case Mesh::ARRAY_BONES: {
|
||||
int count = skin_weights == SKIN_8_WEIGHTS ? 8 : 4;
|
||||
Vector<int> array;
|
||||
array.resize_zeroed(varr_len * count);
|
||||
array.resize_initialized(varr_len * count);
|
||||
int *w = array.ptrw();
|
||||
|
||||
for (uint32_t idx = 0; idx < vertex_array.size(); idx++) {
|
||||
|
|
@ -668,7 +668,7 @@ Array SurfaceTool::commit_to_arrays() {
|
|||
Vector<float> array;
|
||||
int count = skin_weights == SKIN_8_WEIGHTS ? 8 : 4;
|
||||
|
||||
array.resize_zeroed(varr_len * count);
|
||||
array.resize_initialized(varr_len * count);
|
||||
float *w = array.ptrw();
|
||||
|
||||
for (uint32_t idx = 0; idx < vertex_array.size(); idx++) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue