aboutsummaryrefslogtreecommitdiff
path: root/extension/src/openvic-extension/utility
diff options
context:
space:
mode:
author hop311 <hop3114@gmail.com>2024-04-21 00:16:45 +0200
committer hop311 <hop3114@gmail.com>2024-04-21 01:22:00 +0200
commit5192708bda86625a40ce67ff297dca8138f9cc13 (patch)
treeedba52a563952d2cf14c6d8f2a4995ac8017c147 /extension/src/openvic-extension/utility
parent2d5454c668fc866023c41f07ceed263b2c1ff237 (diff)
Pre-allocate and use std::move for Godot Arrays and Dictionariesarray-dict-tweaks
Diffstat (limited to 'extension/src/openvic-extension/utility')
-rw-r--r--extension/src/openvic-extension/utility/Utilities.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/extension/src/openvic-extension/utility/Utilities.cpp b/extension/src/openvic-extension/utility/Utilities.cpp
index 7450212..4389e95 100644
--- a/extension/src/openvic-extension/utility/Utilities.cpp
+++ b/extension/src/openvic-extension/utility/Utilities.cpp
@@ -80,7 +80,8 @@ static Ref<Image> load_dds_image(String const& path) {
);
PackedByteArray pixels;
- pixels.resize(size);
+ ERR_FAIL_COND_V(pixels.resize(size) != OK, nullptr);
+
/* Index offset used to control whether we are reading */
const size_t rb_idx = 2 * needs_bgr_to_rgb;
uint8_t const* ptr = static_cast<uint8_t const*>(texture.data());