diff options
author | Juan Linietsky <juan@godotengine.org> | 2020-02-24 15:20:53 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2020-02-25 12:55:53 +0100 |
commit | 33b5c571995cce60a21784ac33fcf958640ed1e2 (patch) | |
tree | b6f087b46a88fe8e2bac093c521da829108714f5 /editor/plugins | |
parent | c19488bd895f911f37bf2c03624d05ea8d0ec1ee (diff) |
Variant: Added 64-bit packed arrays, renamed Variant::REAL to FLOAT.
- Renames PackedIntArray to PackedInt32Array.
- Renames PackedFloatArray to PackedFloat32Array.
- Adds PackedInt64Array and PackedFloat64Array.
- Renames Variant::REAL to Variant::FLOAT for consistency.
Packed arrays are for storing large amount of data and creating stuff like
meshes, buffers. textures, etc. Forcing them to be 64 is a huge waste of
memory. That said, many users requested the ability to have 64 bits packed
arrays for their games, so this is just an optional added type.
For Variant, the float datatype is always 64 bits, and exposed as `float`.
We still have `real_t` which is the datatype that can change from 32 to 64
bits depending on a compile flag (not entirely working right now, but that's
the idea). It affects math related datatypes and code only.
Neither Variant nor PackedArray make use of real_t, which is only intended
for math precision, so the term is removed from there to keep only float.
Diffstat (limited to 'editor/plugins')
-rw-r--r-- | editor/plugins/script_text_editor.cpp | 6 | ||||
-rw-r--r-- | editor/plugins/spatial_editor_plugin.cpp | 2 | ||||
-rw-r--r-- | editor/plugins/sprite_editor_plugin.cpp | 2 | ||||
-rw-r--r-- | editor/plugins/tile_set_editor_plugin.cpp | 2 | ||||
-rw-r--r-- | editor/plugins/visual_shader_editor_plugin.cpp | 2 |
5 files changed, 8 insertions, 6 deletions
diff --git a/editor/plugins/script_text_editor.cpp b/editor/plugins/script_text_editor.cpp index 4986e60ff0..4e0787c805 100644 --- a/editor/plugins/script_text_editor.cpp +++ b/editor/plugins/script_text_editor.cpp @@ -307,8 +307,10 @@ void ScriptTextEditor::_set_theme_for_script() { text_edit->add_keyword_color("Dictionary", basetype_color); text_edit->add_keyword_color("Array", basetype_color); text_edit->add_keyword_color("PackedByteArray", basetype_color); - text_edit->add_keyword_color("PackedIntArray", basetype_color); - text_edit->add_keyword_color("PackedRealArray", basetype_color); + text_edit->add_keyword_color("PackedInt32Array", basetype_color); + text_edit->add_keyword_color("PackedFloat32Array", basetype_color); + text_edit->add_keyword_color("PackedInt64Array", basetype_color); + text_edit->add_keyword_color("PackedFloat64Array", basetype_color); text_edit->add_keyword_color("PackedStringArray", basetype_color); text_edit->add_keyword_color("PackedVector2Array", basetype_color); text_edit->add_keyword_color("PackedVector3Array", basetype_color); diff --git a/editor/plugins/spatial_editor_plugin.cpp b/editor/plugins/spatial_editor_plugin.cpp index 6e8eeaec82..4c8a0590fd 100644 --- a/editor/plugins/spatial_editor_plugin.cpp +++ b/editor/plugins/spatial_editor_plugin.cpp @@ -6042,7 +6042,7 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) { EDITOR_DEF("editors/3d/manipulator_gizmo_size", 80); EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::INT, "editors/3d/manipulator_gizmo_size", PROPERTY_HINT_RANGE, "16,1024,1")); EDITOR_DEF("editors/3d/manipulator_gizmo_opacity", 0.4); - EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::REAL, "editors/3d/manipulator_gizmo_opacity", PROPERTY_HINT_RANGE, "0,1,0.01")); + EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::FLOAT, "editors/3d/manipulator_gizmo_opacity", PROPERTY_HINT_RANGE, "0,1,0.01")); over_gizmo_handle = -1; } diff --git a/editor/plugins/sprite_editor_plugin.cpp b/editor/plugins/sprite_editor_plugin.cpp index 92bdbdd733..c35afa0644 100644 --- a/editor/plugins/sprite_editor_plugin.cpp +++ b/editor/plugins/sprite_editor_plugin.cpp @@ -376,7 +376,7 @@ void SpriteEditor::_convert_to_polygon_2d_node() { Vector<Vector2> outline = computed_outline_lines[i]; Vector<Vector2> uv_outline = outline_lines[i]; - PackedIntArray pia; + PackedInt32Array pia; pia.resize(outline.size()); int *pia_write = pia.ptrw(); diff --git a/editor/plugins/tile_set_editor_plugin.cpp b/editor/plugins/tile_set_editor_plugin.cpp index 02c3709766..a61b291029 100644 --- a/editor/plugins/tile_set_editor_plugin.cpp +++ b/editor/plugins/tile_set_editor_plugin.cpp @@ -3507,7 +3507,7 @@ void TilesetEditorContext::_get_property_list(List<PropertyInfo> *p_list) const p_list->push_back(PropertyInfo(Variant::OBJECT, "selected_collision", PROPERTY_HINT_RESOURCE_TYPE, tileset_editor->edited_collision_shape->get_class())); if (tileset_editor->edited_collision_shape.is_valid()) { p_list->push_back(PropertyInfo(Variant::BOOL, "selected_collision_one_way", PROPERTY_HINT_NONE)); - p_list->push_back(PropertyInfo(Variant::REAL, "selected_collision_one_way_margin", PROPERTY_HINT_NONE)); + p_list->push_back(PropertyInfo(Variant::FLOAT, "selected_collision_one_way_margin", PROPERTY_HINT_NONE)); } } if (tileset_editor->edit_mode == TileSetEditor::EDITMODE_NAVIGATION && tileset_editor->edited_navigation_shape.is_valid()) { diff --git a/editor/plugins/visual_shader_editor_plugin.cpp b/editor/plugins/visual_shader_editor_plugin.cpp index e228f25c62..568e484cac 100644 --- a/editor/plugins/visual_shader_editor_plugin.cpp +++ b/editor/plugins/visual_shader_editor_plugin.cpp @@ -648,7 +648,7 @@ void VisualShaderEditor::_update_graph() { button->set_text(((bool)default_value) ? "true" : "false"); } break; case Variant::INT: - case Variant::REAL: { + case Variant::FLOAT: { button->set_text(String::num(default_value, 4)); } break; case Variant::VECTOR3: { |