summaryrefslogtreecommitdiff
path: root/scene/resources
diff options
context:
space:
mode:
Diffstat (limited to 'scene/resources')
-rw-r--r--scene/resources/animation.cpp6
-rw-r--r--scene/resources/syntax_highlighter.cpp4
2 files changed, 7 insertions, 3 deletions
diff --git a/scene/resources/animation.cpp b/scene/resources/animation.cpp
index e6a74e7685..80e338c8e8 100644
--- a/scene/resources/animation.cpp
+++ b/scene/resources/animation.cpp
@@ -83,9 +83,11 @@ bool Animation::_set(const StringName &p_name, const Variant &p_value) {
const real_t *r = values.ptr();
- tt->transforms.resize(vcount / 12);
+ int transform3d_size = (int)sizeof(Transform3D);
- for (int i = 0; i < (vcount / 12); i++) {
+ tt->transforms.resize(vcount / transform3d_size);
+
+ for (int i = 0; i < (vcount / transform3d_size); i++) {
TKey<TransformKey> &tk = tt->transforms.write[i];
const real_t *ofs = &r[i * 12];
tk.time = ofs[0];
diff --git a/scene/resources/syntax_highlighter.cpp b/scene/resources/syntax_highlighter.cpp
index e1c5ebb005..52a3abf74d 100644
--- a/scene/resources/syntax_highlighter.cpp
+++ b/scene/resources/syntax_highlighter.cpp
@@ -43,7 +43,9 @@ Dictionary SyntaxHighlighter::get_line_syntax_highlighting(int p_line) {
return color_map;
}
- GDVIRTUAL_CALL(_get_line_syntax_highlighting, p_line, color_map);
+ if (!GDVIRTUAL_CALL(_get_line_syntax_highlighting, p_line, color_map)) {
+ color_map = _get_line_syntax_highlighting_impl(p_line);
+ }
highlighting_cache[p_line] = color_map;
return color_map;