diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2022-08-23 08:52:13 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-23 08:52:13 +0200 |
commit | 62c3e72b6f3e6fb628ffcb2d062dcbb5de304867 (patch) | |
tree | dccdf3ce6517b6a7ac72ba845ac747b92f06a302 /modules/text_server_adv | |
parent | 4fbfd10dccc297295e80407fb411de2506cb9838 (diff) | |
parent | 8be27dc59e3e330e10079ba8cbc999c80cab0ddc (diff) |
Merge pull request #63959 from KoBeWi/typo_arrray
Replace Array return types with TypedArray (part 1)
Diffstat (limited to 'modules/text_server_adv')
-rw-r--r-- | modules/text_server_adv/text_server_adv.cpp | 22 | ||||
-rw-r--r-- | modules/text_server_adv/text_server_adv.h | 6 |
2 files changed, 14 insertions, 14 deletions
diff --git a/modules/text_server_adv/text_server_adv.cpp b/modules/text_server_adv/text_server_adv.cpp index f6180f6c4c..e80eb43369 100644 --- a/modules/text_server_adv/text_server_adv.cpp +++ b/modules/text_server_adv/text_server_adv.cpp @@ -2170,12 +2170,12 @@ double TextServerAdvanced::font_get_oversampling(const RID &p_font_rid) const { return fd->oversampling; } -Array TextServerAdvanced::font_get_size_cache_list(const RID &p_font_rid) const { +TypedArray<Vector2i> TextServerAdvanced::font_get_size_cache_list(const RID &p_font_rid) const { FontAdvanced *fd = font_owner.get_or_null(p_font_rid); - ERR_FAIL_COND_V(!fd, Array()); + ERR_FAIL_COND_V(!fd, TypedArray<Vector2i>()); MutexLock lock(fd->mutex); - Array ret; + TypedArray<Vector2i> ret; for (const KeyValue<Vector2i, FontForSizeAdvanced *> &E : fd->cache) { ret.push_back(E.key); } @@ -2454,15 +2454,15 @@ PackedInt32Array TextServerAdvanced::font_get_texture_offsets(const RID &p_font_ return tex.offsets; } -Array TextServerAdvanced::font_get_glyph_list(const RID &p_font_rid, const Vector2i &p_size) const { +PackedInt32Array TextServerAdvanced::font_get_glyph_list(const RID &p_font_rid, const Vector2i &p_size) const { FontAdvanced *fd = font_owner.get_or_null(p_font_rid); - ERR_FAIL_COND_V(!fd, Array()); + ERR_FAIL_COND_V(!fd, PackedInt32Array()); MutexLock lock(fd->mutex); Vector2i size = _get_size_outline(fd, p_size); - ERR_FAIL_COND_V(!_ensure_cache_for_size(fd, size), Array()); + ERR_FAIL_COND_V(!_ensure_cache_for_size(fd, size), PackedInt32Array()); - Array ret; + PackedInt32Array ret; const HashMap<int32_t, FontGlyph> &gl = fd->cache[size]->glyph_map; for (const KeyValue<int32_t, FontGlyph> &E : gl) { ret.push_back(E.key); @@ -2811,16 +2811,16 @@ Dictionary TextServerAdvanced::font_get_glyph_contours(const RID &p_font_rid, in #endif } -Array TextServerAdvanced::font_get_kerning_list(const RID &p_font_rid, int64_t p_size) const { +TypedArray<Vector2i> TextServerAdvanced::font_get_kerning_list(const RID &p_font_rid, int64_t p_size) const { FontAdvanced *fd = font_owner.get_or_null(p_font_rid); - ERR_FAIL_COND_V(!fd, Array()); + ERR_FAIL_COND_V(!fd, TypedArray<Vector2i>()); MutexLock lock(fd->mutex); Vector2i size = _get_size(fd, p_size); - ERR_FAIL_COND_V(!_ensure_cache_for_size(fd, size), Array()); + ERR_FAIL_COND_V(!_ensure_cache_for_size(fd, size), TypedArray<Vector2i>()); - Array ret; + TypedArray<Vector2i> ret; for (const KeyValue<Vector2i, FontForSizeAdvanced *> &E : fd->cache) { ret.push_back(E.key); } diff --git a/modules/text_server_adv/text_server_adv.h b/modules/text_server_adv/text_server_adv.h index 7ae329d616..6c3e8dbdcb 100644 --- a/modules/text_server_adv/text_server_adv.h +++ b/modules/text_server_adv/text_server_adv.h @@ -537,7 +537,7 @@ public: virtual void font_set_oversampling(const RID &p_font_rid, double p_oversampling) override; virtual double font_get_oversampling(const RID &p_font_rid) const override; - virtual Array font_get_size_cache_list(const RID &p_font_rid) const override; + virtual TypedArray<Vector2i> font_get_size_cache_list(const RID &p_font_rid) const override; virtual void font_clear_size_cache(const RID &p_font_rid) override; virtual void font_remove_size_cache(const RID &p_font_rid, const Vector2i &p_size) override; @@ -566,7 +566,7 @@ public: virtual void font_set_texture_offsets(const RID &p_font_rid, const Vector2i &p_size, int64_t p_texture_index, const PackedInt32Array &p_offset) override; virtual PackedInt32Array font_get_texture_offsets(const RID &p_font_rid, const Vector2i &p_size, int64_t p_texture_index) const override; - virtual Array font_get_glyph_list(const RID &p_font_rid, const Vector2i &p_size) const override; + virtual PackedInt32Array font_get_glyph_list(const RID &p_font_rid, const Vector2i &p_size) const override; virtual void font_clear_glyphs(const RID &p_font_rid, const Vector2i &p_size) override; virtual void font_remove_glyph(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph) override; @@ -590,7 +590,7 @@ public: virtual Dictionary font_get_glyph_contours(const RID &p_font, int64_t p_size, int64_t p_index) const override; - virtual Array font_get_kerning_list(const RID &p_font_rid, int64_t p_size) const override; + virtual TypedArray<Vector2i> font_get_kerning_list(const RID &p_font_rid, int64_t p_size) const override; virtual void font_clear_kerning_map(const RID &p_font_rid, int64_t p_size) override; virtual void font_remove_kerning(const RID &p_font_rid, int64_t p_size, const Vector2i &p_glyph_pair) override; |