summaryrefslogtreecommitdiffstats
path: root/scene/resources
diff options
context:
space:
mode:
authorreduz <reduzio@gmail.com>2020-10-28 15:34:27 -0300
committerreduz <reduzio@gmail.com>2020-10-28 18:53:32 -0300
commit8ab9b397070174aab7b20cdcd97506db25fb919d (patch)
tree521d77e32b056dee703eb96ecbb54ab939f19c6a /scene/resources
parent2eaedcf14e515eb589885025b46d0aedc492830a (diff)
downloadredot-engine-8ab9b397070174aab7b20cdcd97506db25fb919d.tar.gz
Implement CanvasGroup and CanvasItem clipping
-Allows merging several 2D objects into a single draw operation -Use current node to clip children nodes -Further fixes to Vulkan barriers -Changed font texture generation to white, fixes dark eges when blurred -Other small misc fixes to backbuffer code.
Diffstat (limited to 'scene/resources')
-rw-r--r--scene/resources/dynamic_font.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/scene/resources/dynamic_font.cpp b/scene/resources/dynamic_font.cpp
index ad9d888480..a0ce6e1194 100644
--- a/scene/resources/dynamic_font.cpp
+++ b/scene/resources/dynamic_font.cpp
@@ -458,8 +458,19 @@ DynamicFontAtSize::TexturePosition DynamicFontAtSize::_find_texture_pos_for_glyp
//zero texture
uint8_t *w = tex.imgdata.ptrw();
ERR_FAIL_COND_V(texsize * texsize * p_color_size > tex.imgdata.size(), ret);
- for (int i = 0; i < texsize * texsize * p_color_size; i++) {
- w[i] = 0;
+
+ if (p_color_size == 2) {
+ for (int i = 0; i < texsize * texsize * p_color_size; i += 2) {
+ w[i + 0] = 255;
+ w[i + 1] = 0;
+ }
+ } else {
+ for (int i = 0; i < texsize * texsize * p_color_size; i += 4) {
+ w[i + 0] = 255;
+ w[i + 1] = 255;
+ w[i + 2] = 255;
+ w[i + 3] = 0;
+ }
}
}
tex.offsets.resize(texsize);