summaryrefslogtreecommitdiff
path: root/scene/resources/font.cpp
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2022-08-26 11:44:24 +0200
committerGitHub <noreply@github.com>2022-08-26 11:44:24 +0200
commitd6267c2d2c4b2c92c02341684fa58035ffb9a3e4 (patch)
treee2213bdd36079bfb4a638b1bc44b00fb3eecd199 /scene/resources/font.cpp
parent4bcb625dae0f2c8bc0f80c656427a7c19994b227 (diff)
parentc6e1432cc0e98047c473f001a17142cbcd98d99e (diff)
Merge pull request #64305 from bruvzg/ts_reset_data
Diffstat (limited to 'scene/resources/font.cpp')
-rw-r--r--scene/resources/font.cpp16
1 files changed, 6 insertions, 10 deletions
diff --git a/scene/resources/font.cpp b/scene/resources/font.cpp
index f8651fecd6..8ac35acd9a 100644
--- a/scene/resources/font.cpp
+++ b/scene/resources/font.cpp
@@ -1817,11 +1817,9 @@ void FontFile::set_data_ptr(const uint8_t *p_data, size_t p_size) {
data_ptr = p_data;
data_size = p_size;
- if (data_ptr != nullptr) {
- for (int i = 0; i < cache.size(); i++) {
- if (cache[i].is_valid()) {
- TS->font_set_data_ptr(cache[i], data_ptr, data_size);
- }
+ for (int i = 0; i < cache.size(); i++) {
+ if (cache[i].is_valid()) {
+ TS->font_set_data_ptr(cache[i], data_ptr, data_size);
}
}
}
@@ -1831,11 +1829,9 @@ void FontFile::set_data(const PackedByteArray &p_data) {
data_ptr = data.ptr();
data_size = data.size();
- if (data_ptr != nullptr) {
- for (int i = 0; i < cache.size(); i++) {
- if (cache[i].is_valid()) {
- TS->font_set_data_ptr(cache[i], data_ptr, data_size);
- }
+ for (int i = 0; i < cache.size(); i++) {
+ if (cache[i].is_valid()) {
+ TS->font_set_data_ptr(cache[i], data_ptr, data_size);
}
}
}